Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vsipl++] [1.3] Mem Leak in vsip::llsqsol?


  • To: Brad Howes <howes@xxxxxxxxxx>
  • Subject: Re: [vsipl++] [1.3] Mem Leak in vsip::llsqsol?
  • From: Don McCoy <don@xxxxxxxxxxxxxxxx>
  • Date: Thu, 29 Nov 2007 17:08:52 -0700

Brad,

I have a fix for your problem!  Since you are building from source, it
should be easy to apply the fix using the command

    patch -p0 < temp_buffer.diff

issued from the top-level directory (the one containing 'src'), or by
editing the file in question manually.

Please let me know if this works for you and thanks again for letting us
know about the problem!


Team,

I tested this patch against Sourcery VSIPL++ v1.3 under x86 Linux, but
it should be applicable to all build variations and all branches.  Ok to
commit?

-- 
Don McCoy
don (at) CodeSourcery
(888) 776-0262 / (650) 331-3385, x712

2007-11-29  Don McCoy  <don@xxxxxxxxxxxxxxxx>

	* src/vsip/core/temp_buffer.hpp: Modified destructor to utilize
	  return_temporary_buffer() to de-allocate memory obtained with
	  get_temporary_buffer().
Index: src/vsip/core/temp_buffer.hpp
===================================================================
--- src/vsip/core/temp_buffer.hpp	(revision 185580)
+++ src/vsip/core/temp_buffer.hpp	(working copy)
@@ -63,7 +63,10 @@
   ~Temp_buffer()
     VSIP_NOTHROW
   {
-    if (is_alloc_) delete[] data_;
+    if (is_alloc_) 
+      delete[] data_;
+    else
+      std::return_temporary_buffer(data_);
   }
 
   T* data() const { return data_; }