//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int MemoryByteSize(void *ptr) { memoryblock_t *block; block = BlockFromPointer(ptr, "MemoryByteSize"); if (!block) return 0; return block->size; } //end of the function MemoryByteSize
int MemoryByteSize(void *ptr) { memoryblock_t *block; block = BlockFromPointer(ptr, "MemoryByteSize"); if (!block) { return 0; } return block->size; }
//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== void FreeMemory(void *ptr) { memoryblock_t *block; block = BlockFromPointer(ptr, "FreeMemory"); if (!block) return; UnlinkMemoryBlock(block); totalmemorysize -= block->size; numblocks--; // free(block); } //end of the function FreeMemory
//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== void FreeMemory(void *ptr) { memoryblock_t *block; block = BlockFromPointer(ptr, "FreeMemory"); if (!block) return; UnlinkMemoryBlock(block); allocatedmemory -= block->size; totalmemorysize -= block->size + sizeof(memoryblock_t); numblocks--; // if (block->id == MEM_ID) { botimport.FreeMemory(block); } //end if } //end of the function FreeMemory