Lines Matching full:block

10  * 2006-06-30     Bernard      fix the allocate/free block bug
25 static void (*rt_mp_alloc_hook)(struct rt_mempool *mp, void *block);
26 static void (*rt_mp_free_hook)(struct rt_mempool *mp, void *block);
36 * block is allocated from memory pool.
40 void rt_mp_alloc_sethook(void (*hook)(struct rt_mempool *mp, void *block)) in rt_mp_alloc_sethook() argument
47 * block is released to memory pool.
51 void rt_mp_free_sethook(void (*hook)(struct rt_mempool *mp, void *block)) in rt_mp_free_sethook() argument
73 * @param block_size the size for each block
96 /* align the block size */ in rt_mp_init()
108 /* initialize free block list */ in rt_mp_init()
181 * @param block_size the size for each block
224 /* initialize free block list */ in rt_mp_create()
297 * This function will allocate a block from memory pool
302 * @return the allocated memory block or RT_NULL on allocated failed
319 /* memory block is unavailable. */ in rt_mp_alloc()
370 /* memory block is available. decrease the free block counter */ in rt_mp_alloc()
373 /* get block from block list */ in rt_mp_alloc()
394 * This function will release a memory block
396 * @param block the address of memory block to be released
398 void rt_mp_free(void *block) in rt_mp_free() argument
405 /* get the control block of pool which the block belongs to */ in rt_mp_free()
406 block_ptr = (rt_uint8_t **)((rt_uint8_t *)block - sizeof(rt_uint8_t *)); in rt_mp_free()
409 RT_OBJECT_HOOK_CALL(rt_mp_free_hook, (mp, block)); in rt_mp_free()
414 /* increase the free block count */ in rt_mp_free()
417 /* link the block into the block list */ in rt_mp_free()