pike.git / src / block_allocator.c

version» Context lines:

pike.git/src/block_allocator.c:158:    while (len > clen) {    memcpy(((char*)(p)) + clen, p, clen);    len -= clen;    clen <<= 1;    }       if (len) memcpy(((char*)(p)) + clen, p, len);    p--;    }    + #ifdef BA_CHAIN_PAGE    do {    char * ptr = (char*)(p+1);       while (ptr < BA_LASTBLOCK(a, p)) {   #ifdef BA_DEBUG    PIKE_MEM_RW(((ba_block_header)ptr)->magic);    ((ba_block_header)ptr)->magic = BA_MARK_FREE;   #endif    ((ba_block_header)ptr)->next = (ba_block_header)(ptr+a->block_size);    ptr+=a->block_size;    }    BA_LASTBLOCK(a, p)->next = NULL;    } while (0); -  + #else +  p->first->next = BA_ONE; + #endif   }      PMOD_EXPORT INLINE void ba_free_all(struct block_allocator * a) {    unsigned int i;       if (!a->allocated) return;       for (i = 0; i < a->num_pages; i++) {    ba_page p = BA_PAGE(a, i+1);    PIKE_MEM_RW_RANGE(BA_BLOCKN(a, 0), BA_PAGESIZE(a));