heap_block_getnext.c 560 B

123456789101112131415161718
  1. #include "private.h"
  2. /*--------------------------------------------------------- */
  3. lub_heap_block_t *
  4. lub_heap_block_getnext(lub_heap_block_t *this)
  5. {
  6. lub_heap_block_t *result = NULL;
  7. lub_heap_tag_t *tail = lub_heap_block__get_tail(this);
  8. /* only go forward if this is not the last block in the segment */
  9. if(0 == tail->segment)
  10. {
  11. /* get a pointer to the first word in the next block */
  12. result = (lub_heap_block_t *)&tail[1];
  13. }
  14. return result;
  15. }
  16. /*--------------------------------------------------------- */