예제 #1
0
inline static void
update_xmalloc_stat_free(uint32_t handle, size_t __n) {
	ATOM_SUB(&_used_memory, __n);
	ATOM_DEC(&_memory_block);
	ssize_t* allocated = get_allocated_field(handle);
	if(allocated) {
		ATOM_SUB(allocated, __n);
	}
}
예제 #2
0
inline static void
update_xmalloc_stat_free(uint32_t handle, size_t __n) {
	__sync_sub_and_fetch(&_used_memory, __n);
	__sync_sub_and_fetch(&_memory_block, 1);
	ssize_t* allocated = get_allocated_field(handle);
	if(allocated) {
		__sync_sub_and_fetch(allocated, __n);
	}
}
예제 #3
0
inline static void 
update_xmalloc_stat_alloc(uint32_t handle, size_t __n) {
	__sync_add_and_fetch(&_used_memory, __n);
	__sync_add_and_fetch(&_memory_block, 1); 
	ssize_t* allocated = get_allocated_field(handle);
	if(allocated) {
		__sync_add_and_fetch(allocated, __n);
	}
	ssize_t* blocknum = get_blocknum(handle);
	if(blocknum) {
		__sync_add_and_fetch(blocknum, 1);
	}
}