inline void EventLogger::Block::terminate ( void ) { for( Block* block = _head; block; ) { Block* next = block->_next; OsMemory_free( block ); block = next; } }
/** * FUNCTION: JVM_FinalizeMemory() * TYPE: public operation * OVERVIEW: Finalize the JVM memory pool * INTERFACE: * parameters: <none> * returns: <nothing> * */ void JVM_FinalizeMemory(void) { int count, size, ret; ret = jvmEndMemory(&count, &size); #ifdef REPORT_LEVEL #if REPORT_LEVEL <= LOG_WARNING if (ret > 0) { reportToLog(LOG_WARNING, LC_MALLOC, "WARNING: %d memory leak(s); %d bytes!\n", count, size); } reportToLog(LOG_WARNING, LC_MALLOC, "** Total memory: %d\n** Highwater mark:%d", JVM_GetTotalHeap(), JvmMemoryHighWaterMark); #endif #endif #ifndef JVM_MALLOC_USE_STATIC #ifdef JVM_MALLOC_USE_CLDC_HI OsMemory_free(JvmMemory); #else free(JvmMemory); #endif JvmMemory = NULL; #endif JvmMemoryStart = NULL; JvmMemoryEnd = NULL; }
void EventLogger::dispose() { if (!UseEventLogger) { return; } LogEntryBlock *blk, *next; for (blk = _head; blk; ) { next = blk->_next; OsMemory_free((void*)blk); blk = next; } }
void OsMemory_free_chunk(address chunk_ptr) { GUARANTEE(chunks[0] == chunk_ptr || chunks[1] == chunk_ptr, "Sanity check"); int i; if (chunks[0] == chunk_ptr) { i = 0; } else { i = 1; } OsMemory_free(chunks_orig[i]); chunks[i] = NULL; }
static void free_bytes(void* p) { OsMemory_free(p); }