Sack Library Documentation
ContentsIndexReferenceHome
sack::memory Namespace Macros
Macros
Name 
Description 
Allocates a block of memory of specific size. Debugging information if passed is recorded on the block. 
Translates from a TEXTCHAR string to a char string. Probably only for UNICODE to non wide translation points. 
A 'safe' release macro. casts the block to the type to release. Makes sure the pointer being released is the type specified. 
Dumps all blocks into the log. 
Dumps all tracked heaps. 
This is macro sack::memory::DupCharToText. 
Converts from 8 bit char to 16 bit wchar (or no-op if not UNICODE compiled) 
This is macro sack::memory::DupTextToChar. 
This is macro sack::memory::DupTextToWide. 
This is macro sack::memory::DupWideToText. 
 
 
Moves a block of memory from one heap to another. 
This can be used to add additional space before the beginning of a memory block. 
This can be used to add additional space after the end of a memory block. 
Hold 
Adds a usage count to a block of memory. For each count added, an additional release must be used. This can be used to keep a copy of the block, even if some other code automatically releases it. 
like also __if_assembly__ extern "C" { 
This duplicates a block of memory. 
New 
A simple macro to allocate a new single unit of a structure. Adds a typecast automatically to be (type*) so C++ compilation is clean. Does not burden the user with extra typecasts. This, being in definition use means that all other things that are typecast are potentially error prone. Memory is considered uninitialized. 
Allocate a new array of type. 
Allocate sizeof(type). Will invoke some sort of registered initializer 
an advantage of C, can define extra space at end of structure which is allowed to carry extra data, which is unknown by other code room for exploits rock. 
Open a shared memory region. The region may be named with a text string (this does not work under linux platforms, and the name of the file to back the shared region is the sharing point). The region may be backed with a file (and must be if it is to be shared on linux.
If the region exists by name, the region is opened, and a pointer to that region is returned.
If the file exists, the file is opened, and mapped into memory, and a pointer to the file backed memory is returned.
if the file does... more 
 
 
Releases an allocated block. Memory becomes free to allocate again. If debugging information is passed, the releasing source and line is recorded in the block. (can be used to find code deallocating memory it shouldn't).
This also works with Hold(), and decrements the hold counter. If there are no more holds on the block, then the block is released. 
Reallocates an array of type. 
Duplicates a string, and returns a pointer to the copy. 
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.