library/src/memory_profiling/BP_LibraryMemoryProfiling.cc
// managed malloc (this is here mostly as a stub in case people want to use this library
// in their own code.  This code actually uses calloc in the backend, so you can be guaranteed
// that all allocations returned are nullified).
managed malloc (this is here mostly as a stub in case people want to use this library
in their own code.  This code actually uses calloc in the backend, so you can be guaranteed
that all allocations returned are nullified).
managed malloc ( this is here mostly as a stub in case people want to use this library in their own code . This code actually uses calloc in the backend so you can be guaranteed that all allocations returned are nullified ) .
void * bpmalloc_real(size_t size, BPLN_PARMS)
{
	if(!BP_GLOBAL_MEMPROF_HASH_TABLE_INIT_OK)
		return malloc(size);
	BP_HASH_TABLE_LOCK_SEM(global_mprof_lock);
	void * new_mem = (void *) BP_HashRegAddMemoryEntry
	(
			&global_mprof_hash_table_registry,
			BP_HASH_REG_MEM_ENTRY_TYPE_GENERIC_ALLOCATION,
			size,
			file_name,
			line_number,
			func
	);
	BP_HASH_TABLE_UNLOCK_SEM(global_mprof_lock);
	return new_mem;
}
void * bpmalloc_real ( size_t size , BPLN_PARMS ) { if ( ! BP_GLOBAL_MEMPROF_HASH_TABLE_INIT_OK ) return malloc ( size ) ; BP_HASH_TABLE_LOCK_SEM ( global_mprof_lock ) ; void * new_mem = ( void * ) BP_HashRegAddMemoryEntry ( & global_mprof_hash_table_registry , BP_HASH_REG_MEM_ENTRY_TYPE_GENERIC_ALLOCATION , size , file_name , line_number , func ) ; BP_HASH_TABLE_UNLOCK_SEM ( global_mprof_lock ) ; return new_mem ; }
managed malloc (this is here mostly as a stub in case people want to use this library
in their own code.
managed malloc ( this is here mostly as a stub in case people want to use this library in their own code .
// If the memory profiler isn't active, immediately return // the allocated memory. // lock the table modification semaphore // add a memory entry // unlock the table modification semaphore // return the new memory