pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:91:    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 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; \ +  } \ +  } \ +  } \ + } while(0)   #define BLOCK_ALLOC(DATA,BSIZE) \    \   struct PIKE_CONCAT(DATA,_block) \   { \    struct PIKE_CONCAT(DATA,_block) *next; \    struct PIKE_CONCAT(DATA,_block) *prev; \    struct DATA *PIKE_CONCAT3(free_,DATA,s); \    INT32 used; \    DO_IF_BLOCK_BACKLOG (INT32 real_used;) \    struct DATA x[BSIZE]; \