Exemplo n.º 1
0
/**
 * \brief this is more efficient version for small nodes number memory pool (< 32)
 */
static void * FindNextAllocatedInSmallPool(uffs_Pool *pool, void *from)
{
	u32 map = 0;
	uffs_PoolEntry *e;
	u32 i;

	for (e = pool->free_list; e; e = e->next)
		map |= (1 << uffs_PoolGetIndex(pool, e));

	for (i = uffs_PoolGetIndex(pool, from); (map & (1 << i)) && i < 32; i++);

	return i < 32 ? uffs_PoolGetBufByIndex(pool, i) : NULL;
}
Exemplo n.º 2
0
Arquivo: uffs_fs.c Projeto: mazj/uffs
/**
 * \return the object by the internal index
 */
uffs_Object * uffs_GetObjectByIndex(int idx)
{
	return (uffs_Object *) uffs_PoolGetBufByIndex(&_object_pool, idx);
}