pike.git
/
src
/
block_alloc.h
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/block_alloc.h:92:
/* 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
) { \
+
struct PIKE_CONCAT(DATA,_block) * p
,
*
np;
\
+
p
=
PIKE_CONCAT(DATA,_blocks);
\
+
while (
p) {
\
int n = p->used; \ int i; \
-
+
np = p->next; \
for (i = 0; n && i < (sizeof(p->x)/sizeof(struct DATA)); i++) { \ BLOCK = &p->x[i]; \ if (FCOND) { \ do CODE while(0); \ --n; \ } \ } \
-
+
p = np; \
} \ } 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); \