heap__get_max_free.c 517 B

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