pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: block_alloc.h,v 1.52 2002/11/23 17:03:00 mast Exp $ + || $Id: block_alloc.h,v 1.53 2002/11/24 20:31:23 mast Exp $   */      #undef PRE_INIT_BLOCK   #undef INIT_BLOCK   #undef EXIT_BLOCK   #undef BLOCK_ALLOC   #undef LOW_PTR_HASH_ALLOC   #undef PTR_HASH_ALLOC_FIXED   #undef PTR_HASH_ALLOC   #undef COUNT_BLOCK
pike.git/src/block_alloc.h:31:   /* 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    + /* Size of the members in the block struct below that doesn'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. */ + #define BLOCK_HEADER_SIZE (3 * sizeof (void *) + sizeof (INT32)) +    #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; \    struct DATA x[BSIZE]; \   }; \
pike.git/src/block_alloc.h:244:    } \    DO_IF_RUN_UNLOCKED(mt_unlock(&PIKE_CONCAT(DATA,_mutex))); \   } \    \   static void PIKE_CONCAT3(free_all_,DATA,_blocks_unlocked)(void) \   { \    struct PIKE_CONCAT(DATA,_block) *tmp; \    DO_IF_DMALLOC( \    for(tmp=PIKE_CONCAT(DATA,_blocks);tmp;tmp=tmp->next) \    { \ -  int tmp2; \ +  size_t tmp2; \    extern void dmalloc_check_block_free(void *p, char *loc); \    for(tmp2=0;tmp2<(BSIZE);tmp2++) \    { \    dmalloc_check_block_free(tmp->x+tmp2, DMALLOC_LOCATION()); \    dmalloc_unregister(tmp->x+tmp2, 1); \    } \    } \    ) \    while((tmp=PIKE_CONCAT(DATA,_blocks))) \    { \