1
0

heap__get_max_free.c 481 B

12345678910111213141516171819
  1. #include "cache.h"
  2. /*--------------------------------------------------------- */
  3. size_t lub_heap__get_max_free(lub_heap_t * this)
  4. {
  5. size_t result = 0;
  6. lub_heap_free_block_t *free_block;
  7. /* get the last block in the tree */
  8. free_block = lub_bintree_findlast(&this->free_tree);
  9. if (NULL != free_block) {
  10. result =
  11. (free_block->tag.words << 2) -
  12. sizeof(lub_heap_alloc_block_t);
  13. }
  14. return result;
  15. }
  16. /*--------------------------------------------------------- */