[Mesa-dev] [PATCH 1/1] clover: Add explicit virtual destructors to argument and scalar_argument class

Jan Vesely jan.vesely at rutgers.edu
Sat May 5 17:22:44 UTC 2018


On Fri, 2018-05-04 at 10:56 -0700, Francisco Jerez wrote:
> Jan Vesely <jan.vesely at rutgers.edu> writes:
> 
> > These are needed to destroy the v vector.
> > Fixes memory leaks on kernel launch.
> > Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> > ---
> >  src/gallium/state_trackers/clover/core/kernel.hpp | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/src/gallium/state_trackers/clover/core/kernel.hpp b/src/gallium/state_trackers/clover/core/kernel.hpp
> > index 4ba6ff467b..218f92cb1d 100644
> > --- a/src/gallium/state_trackers/clover/core/kernel.hpp
> > +++ b/src/gallium/state_trackers/clover/core/kernel.hpp
> > @@ -93,6 +93,7 @@ namespace clover {
> >           /// Free any resources that were allocated in bind().
> >           virtual void unbind(exec_context &ctx) = 0;
> >  
> > +         virtual ~argument() {};
> >        protected:
> >           argument();
> >  
> > @@ -143,6 +144,7 @@ namespace clover {
> >        class scalar_argument : public argument {
> >        public:
> >           scalar_argument(size_t size);
> > +         virtual ~scalar_argument() {};
> 
> This line shouldn't be necessary.  With that fixed:
> 
> Reviewed-by: Francisco Jerez <currojerez at riseup.net>

thanks, fixed locally (also adapted the commit message) and pushed.
just fyi: this allows math_bruteforce conformance test to finish on
carrizo (1 error) instead of running out of memory half way through.

JAn

> 
> Thanks!
> 
> >  
> >           virtual void set(size_t size, const void *value);
> >           virtual void bind(exec_context &ctx,
> > -- 
> > 2.17.0

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180505/a543e54c/attachment-0001.sig>


More information about the mesa-dev mailing list