pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:94:    ((PIKE_MALLOC_PAGE_SIZE * (PAGES)) - BLOCK_HEADER_SIZE) / \    sizeof (struct DATA))      #define PTR_HASH_ALLOC_FIXED_FILL_PAGES(DATA, PAGES) \    PTR_HASH_ALLOC_FIXED(DATA, \    ((PIKE_MALLOC_PAGE_SIZE * (PAGES)) - BLOCK_HEADER_SIZE) / \    sizeof (struct DATA))      #define MS(x) #x    + #define BLOCK_ALLOC_IN_USE(DATA) (!!PIKE_CONCAT (DATA, _allocator).num_pages) +    #define WALK_NONFREE_BLOCKS(DATA, BLOCK, FCOND, CODE...) do { \    struct block_allocator * a = &PIKE_CONCAT(DATA, _allocator); \    PAGE_LOOP(a, { \    uint32_t i, used = (p == a->alloc) ? a->blocks : p->used; \    for (i = 0; used && i < a->blocks; i++) { \    BLOCK = ((struct DATA*)(p+1)) + i; \    if (FCOND) { \    do CODE while(0); \    --used; \    } \
pike.git/src/block_alloc.h:183:    sizeof (struct DATA))      /* Size of the members in the block struct below that don't contain    * the payload data (i.e. that aren't x). This can be used in BSIZE to    * make the block fit within a page. */   #ifndef BLOCK_HEADER_SIZE   #define BLOCK_HEADER_SIZE (3 * sizeof (void *) + sizeof (INT32) \    DO_IF_DMALLOC( + sizeof(INT32)))   #endif    + #define BLOCK_ALLOC_IN_USE(DATA) (!!PIKE_CONCAT (DATA, _blocks)) +    #define WALK_NONFREE_BLOCKS(DATA, BLOCK, FCOND, CODE) do { \    struct PIKE_CONCAT(DATA,_block) * p; \    for(p=PIKE_CONCAT(DATA,_blocks);p;p=p->next) { \    int n = p->used; \    int i; \    for (i = 0; n && i < (sizeof(p->x)/sizeof(struct DATA)); i++) { \    BLOCK = &p->x[i]; \    if (FCOND) { \    do CODE while(0); \    --n; \