library/src/datastructures/BP-HashTable.cc
// simple wrapper to calloc items in calloc form
simple wrapper to calloc items in calloc form
simple wrapper to calloc items in calloc form
void * ht_calloc_real
(
		P_BP_HASH_TABLE_REGISTRY hreg,
		size_t size,
		size_t size_n,
		BPLN_PARMS
)
{
	BP_GLOBAL_HASH_TABLE_OVERRIDE(NULL);
	if(!hreg)
		return NULL;
	BP_HASH_TABLE_ENTER_CRITICAL_SECTION(hreg);
	void * new_entry = BP_HashRegAddMemoryEntry
	(
			hreg,
			BP_HASH_REG_MEM_ENTRY_TYPE_GENERIC_ALLOCATION,
			size * size_n,
			BPLN_PARMS_PASSTHROUGH
	);
	BP_HASH_TABLE_LEAVE_CRITICAL_SECTION(hreg);
	return new_entry;
}
void * ht_calloc_real ( P_BP_HASH_TABLE_REGISTRY hreg , size_t size , size_t size_n , BPLN_PARMS ) { BP_GLOBAL_HASH_TABLE_OVERRIDE ( NULL ) ; if ( ! hreg ) return NULL ; BP_HASH_TABLE_ENTER_CRITICAL_SECTION ( hreg ) ; void * new_entry = BP_HashRegAddMemoryEntry ( hreg , BP_HASH_REG_MEM_ENTRY_TYPE_GENERIC_ALLOCATION , size * size_n , BPLN_PARMS_PASSTHROUGH ) ; BP_HASH_TABLE_LEAVE_CRITICAL_SECTION ( hreg ) ; return new_entry ; }
simple wrapper to calloc items in calloc form
simple wrapper to calloc items in calloc form
// macro to override hreg on null // ensure we have a registry // enter critical section // attempt to allocate the entry within the hash registry // leave critical section // return the new entry