pike.git / src / block_allocator.c

version» Context lines:

pike.git/src/block_allocator.c:501:       if (v.length < l->blocks) {    *t = BA_BLOCKN(*l, p, v.length);    (*t)->next = BA_ONE;    } else *t = NULL;       return b;   }      static INLINE void ba_list_defined(struct block_allocator * a, struct ba_block_header * b) { + #ifdef USE_VALGRIND    while (b && b != BA_ONE) {    PIKE_MEMPOOL_ALLOC(a, b, a->l.block_size);    PIKE_MEM_RW_RANGE(b, sizeof(struct ba_block_header));    b = b->next;    } -  + #endif   }      static INLINE void ba_list_undefined(struct block_allocator * a, struct ba_block_header * b) { -  + #ifdef USE_VALGRIND    while (b && b != BA_ONE) {    struct ba_block_header * next = b->next;    PIKE_MEMPOOL_FREE(a, b, a->l.block_size);    b = next;    } -  + #endif   }      /*    * This function allows iteration over all allocated blocks. Some things are not allowed:    * - throwing from within the callback    * - allocating blocks during iteration    * - nested iteration    *    * - freeing is OK, however some nodes will _still_ beiterated over, when they are freed during the    * iteration.