Sack Library 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 POINTER MEM_API AllocateEx ( PTRSZVAL nSize DBG_PASS ); #define Allocate(n) AllocateEx(n DBG_SRC ) | |
|
| |
|
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. | |
| ||
|
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. |
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. | |
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. | |
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. |
Name |
Description |
This is type sack::memory::PMEM. |
Copyright (c) 2000+. All rights reserved.
|
What do you think about this topic? Send feedback!
|