Location: Symbol Reference > Functions > JwLocalAllocMem Function
JWSCL Documentation
ContentsIndexHome
PreviousUpNext
JwLocalAllocMem Function
Pascal
function JwLocalAllocMem(uFlags: UINT; uBytes: SIZE_T): HLOCAL;

JwLocalAllocMem creates a managed memory handle by LocalAlloc. Some memory leak managers do not recognize leaks created by LocalAlloc and GlobalAlloc. Thus we create for them a GetMem memory block. Replace each call to LocalAlloc/GlobalAlloc with JwLocalAllocMem/JwGlobalAllocMem and their counter parts JwLocalFreeMem/JwGlobalFreeMem. If a counter part is not called and the program halts the memory manager will (hopefully) show the stack trace to the GetMemPointer created by JwLocalAllocMem/JwGlobalAllocMem

Warning: Do not call JwLocalAllocMem/JwGlobalAllocMem for API functions that will free the handle. GetMemPointer will remain whatsoever. Instead use LocalAlloc/GlobalAlloc. This behavior is rare but the API documentation will (mostly) say it. Refer to MSDN documentation for more information.

Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc.
What do you think about this topic? Send feedback!