pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:65:   /* Block Alloc UnLocked */   #define BA_UL(X) PIKE_CONCAT(X,_unlocked)   #define BA_STATIC static   #define BA_INLINE INLINE   #else   #define BA_UL(X) X   #define BA_STATIC   #define BA_INLINE   #endif    - #ifdef PIKE_NEW_BLOCK_ALLOC + #if 0 /*def PIKE_NEW_BLOCK_ALLOC*/   # define ba_error Pike_error   # include "global.h"   # include "pike_error.h"   # include "pike_memory.h"   # define EXPORT PMOD_EXPORT   # include "gjalloc.h"   # undef EXPORT   /* we assume here that malloc has 8 bytes of overhead */   #define BLOCK_HEADER_SIZE (sizeof(struct ba_page) + sizeof(void*))   
pike.git/src/block_alloc.h:99:    ((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); \    if (a->alloc) a->alloc->h = a->h; \ +  if (a->last_free) a->last_free->h = a->hf; \    PAGE_LOOP(a, { \    uint32_t i, used = p->h.used; \    for (i = 0; used && i < a->l.blocks; i++) { \    BLOCK = ((struct DATA*)(p+1)) + i; \    if (FCOND) { \    do CODE while(0); \    --used; \    } \    } \    }); \