Sack Library Documentation
ContentsIndexReferenceHome
PreviousUpNext
Functions

The following table lists functions in this documentation.

 
Name 
Description 
 
Allocates a block of memory of specific size. Debugging information if passed is recorded on the block. 
 
Closes a shared memory region. Calls CloseSpaceEx() with bFinal set TRUE
 
Closes a memory region. Release can also be used to close opened spaces. 
 
Translates from a TEXTCHAR string to a char string. Probably only for UNICODE to non wide translation points. 
 
Get the length of a string in C chars. 
 
Dumps all blocks into the log. 
 
Dumps a heap to a specific file. 
 
Dumps all blocks into the log. 
 
Dumps a heap to a specific file. 
 
not so much of a fragment as a consolidation. Finds a free spot earlier in the heap and attempts to move the block there. This can help alleviate heap fragmentation. 
 
Translates from a TEXTCHAR string to a wchar_t string. Probably only for UNICODE to non wide translation points. 
 
Converts from 8 bit char to 16 bit wchar (or no-op if not UNICODE compiled) 
 
Translates from a TEXTCHAR string to a wchar_t string. Probably only for UNICODE to non wide translation points. 
 
Translates from a TEXTCHAR string to a wchar_t string. Probably only for UNICODE to non wide translation points. 
 
Translates from a TEXTCHAR string to a wchar_t string. Probably only for UNICODE to non wide translation points. 
 
 
 
 
MEM_PROC void MEM_API GetHeapMemStats ( PMEM pHeap, _32 *pFree, _32 *pUsed, _32 *pChunks, _32 *pFreeChunks ); 
 
This can give the size back of a memory space. 
 
 
 
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. 
 
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. 
 
even if pMem is just a POINTER returned from OpenSpace this will create a valid heap pointer.
will result TRUE if a valid heap is present will result FALSE if heap is not able to init (has content) 
 
Does a multi-processor safe decrement on a variable. 
 
Multiprocessor safe swap of the contents of a variable with a new value, and result with the old variable. 
 
multi-processor safe exchange the value in a 64 bit variable with another value. 
 
Multi-processor safe exchange operation. Returns the prior value at the pointer. 
 
A multi-processor safe increment of a variable. 
 
#define _memcpy_ MemCpy Binary byte comparison of one block of memory to another. Results -1 if less, 1 if more and 0 if equal. 
 
#define _memset_ MemSet memory copy operation. not safe when buffers overlap. Performs platform-native memory stream operation to copy from one place in memory to another. (32 or 64 bit operations as possible). 
 
This duplicates a block of memory
 
Sets a 32 bit value into memory. If the length to set is not a whole number of 32 bit words, the last bytes may contain the low 16 bits of the value and the low 8 bits. 
 
 
 
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. 
 
disables storing file/line, also disables auto GetMemStats checking 
 
Sets whether to log allocations or not.
returns the prior state of logging... 
 
Sets whether to log critical sections or not.
returns the prior state of logging... 
 
Sets how much a heap is expanded by when it is out of space. Default is like 512k. 
 
disables auto GemMemStats on every allocate/release/Hold
GetMemStats will evaluate each and every block allocated in memory and inspect it for corruption. 
 
Sets the minimum size to allocate. If a block size less than this is allocated, then this much is actually allocated. 
 
returns the size of a memory block which was Allocate()'d. 
 
Compares two strings, case insensitively. 
 
String insensitive case comparison with maximum length specified. 
 
Searches for one string in another. Compares case insensitively. 
 
This searches a string for the first character that matches some specified character.
A custom strchr function, since microsoft is saying this is an unsafe function. This Compiles to compare native strings, if UNICODE uses unicode, otherwise uses 8 bit characters. 
 
This searches a string for the first character that matches some specified character.
A custom strchr function, since microsoft is saying this is an unsafe function. This Compiles to compare native strings, if UNICODE uses unicode, otherwise uses 8 bit characters. 
 
Compares two strings. Must match exactly. 
 
Compares two strings. Must match exactly. 
 
 
 
copy S2 to S1. This is 'unsafe', since neither paramter's size is known. Prefer StrCpyEx which passes the maximum length for S1. 
 
copy S2 to S1, with a maximum of N characters.
The last byte of S1 will always be a 'nul'. If S2 was longer than S1, then it will be truncated to fit within S1. Perferred method over this is SaveText or StrDup
 
Duplicates a string, and returns a pointer to the copy. 
 
Returns the count of characters in a string. 
 
Finds the last instance of a character in a string. 
 
This searches a string for the last character that matches some specified character.
A custom strrchr function, since microsoft is saying this is an unsafe function. This Compiles to compare native strings, if UNICODE uses unicode, otherwise uses 8 bit characters. 
 
Finds an instance of a string in another string.
Custom implementation because strstr is declared unsafe, and to handle switching between unicode and char. 
 
Finds an instance of a string in another string.
Custom implementation because strstr is declared unsafe, and to handle switching between unicode and char. 
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.
What do you think about this topic? Send feedback!