示例#1
0
文件: lxc_emul.c 项目: javigon/genode
void *alloc_large_system_hash(const char *tablename,
	                            unsigned long bucketsize,
	                            unsigned long numentries,
	                            int scale,
	                            int flags,
	                            unsigned int *_hash_shift,
	                            unsigned int *_hash_mask,
	                            unsigned long low_limit,
	                            unsigned long high_limit)
{
	unsigned long elements = numentries ? numentries : high_limit;
	unsigned long nlog2 = ilog2(elements);
	nlog2 <<= (1 << nlog2) < elements ? 1 : 0;

	void *table = dde_kit_simple_malloc(elements * bucketsize);

	if (_hash_mask)
		*_hash_mask = (1 << nlog2) - 1;
	if (_hash_shift)
		*_hash_shift = nlog2;

	return table;
}
示例#2
0
void *__kmalloc(size_t size, gfp_t flags)
{
    return dde_kit_simple_malloc(size);
}
示例#3
0
void *vmalloc(unsigned long size)
{
	return dde_kit_simple_malloc(size);
}