[Patch] cygheap.cc: Allow _crealloc to shrink memory-block.

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Tue Oct 12 22:31:00 GMT 2004


On Wed, Oct 13, 2004 at 12:11:24AM +0200, Bas van Gompel wrote:
>Following (trivial IMO) patch, allows memory blocks on the cygheap to
>be shrunk.
>
>There are some issues with this:
>- The code is slightly slower.
>- This change is in a block of code marked ``copyright D. J. Delorie''.
>- I'm not sure _crealloc is ever called with a smaller size. (If it
>  isn't, this patch is useless.)
>
>(I did test this, and it WJFFM.)

Thanks, but I don't see any reason to go to the effort of allocating a
new block of memory in order to get a smaller block of memory.  The
overhead of allocating memory, which could actually cause a call to the
OS, shouldn't be worth it unless you're suffering from severe memory
constraints.  I don't believe that is normally the case for cygheap.

cgf



More information about the Cygwin-patches mailing list