heap_foreach_segment.c 481 B

123456789101112131415161718
  1. /*
  2. * heap_foreach_segment.c
  3. */
  4. #include "private.h"
  5. /*--------------------------------------------------------- */
  6. void
  7. lub_heap_foreach_segment(lub_heap_t * this, lub_heap_foreach_fn * fn, void *arg)
  8. {
  9. lub_heap_segment_t *segment;
  10. unsigned int i = 1;
  11. for (segment = &this->first_segment; segment; segment = segment->next) {
  12. /* call the client function */
  13. fn(segment, i++, (segment->words << 2), arg);
  14. }
  15. }
  16. /*--------------------------------------------------------- */