Select Git revision
block_alloc.h
-
Martin Stjernholm authored
Rev: src/apply_low.h:1.19 Rev: src/backend.cmod:1.43 Rev: src/block_alloc.h:1.68 Rev: src/builtin_functions.c:1.497 Rev: src/cyclic.c:1.11 Rev: src/encode.c:1.190 Rev: src/fdlib.c:1.63 Rev: src/fsort_template.h:1.16 Rev: src/gc.c:1.220 Rev: src/interpret.c:1.307 Rev: src/interpret.h:1.142 Rev: src/interpret_functions.h:1.151 Rev: src/las.c:1.336 Rev: src/main.c:1.177 Rev: src/mapping.c:1.168 Rev: src/mapping.h:1.50 Rev: src/modules/Oracle/oracle.c:1.78 Rev: src/modules/_Charset/misc.c:1.14 Rev: src/multiset.c:1.74 Rev: src/object.c:1.238 Rev: src/object.h:1.79 Rev: src/pike_macros.h:1.37 Rev: src/pike_memory.c:1.146 Rev: src/pike_search.c:1.16 Rev: src/pike_search_engine2.c:1.9 Rev: src/pike_threadlib.h:1.47 Rev: src/pike_types.c:1.218 Rev: src/port.c:1.72 Rev: src/port.h:1.51 Rev: src/signal_handler.c:1.274 Rev: src/svalue.c:1.168 Rev: src/threads.c:1.219
Martin Stjernholm authoredRev: src/apply_low.h:1.19 Rev: src/backend.cmod:1.43 Rev: src/block_alloc.h:1.68 Rev: src/builtin_functions.c:1.497 Rev: src/cyclic.c:1.11 Rev: src/encode.c:1.190 Rev: src/fdlib.c:1.63 Rev: src/fsort_template.h:1.16 Rev: src/gc.c:1.220 Rev: src/interpret.c:1.307 Rev: src/interpret.h:1.142 Rev: src/interpret_functions.h:1.151 Rev: src/las.c:1.336 Rev: src/main.c:1.177 Rev: src/mapping.c:1.168 Rev: src/mapping.h:1.50 Rev: src/modules/Oracle/oracle.c:1.78 Rev: src/modules/_Charset/misc.c:1.14 Rev: src/multiset.c:1.74 Rev: src/object.c:1.238 Rev: src/object.h:1.79 Rev: src/pike_macros.h:1.37 Rev: src/pike_memory.c:1.146 Rev: src/pike_search.c:1.16 Rev: src/pike_search_engine2.c:1.9 Rev: src/pike_threadlib.h:1.47 Rev: src/pike_types.c:1.218 Rev: src/port.c:1.72 Rev: src/port.h:1.51 Rev: src/signal_handler.c:1.274 Rev: src/svalue.c:1.168 Rev: src/threads.c:1.219
block_alloc.h 26.68 KiB
/*
|| 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.68 2003/06/30 17:06:08 mast Exp $
*/
#undef PRE_INIT_BLOCK
#undef DO_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
#undef COUNT_OTHER
#undef BLOCK_ALLOC_HSIZE_SHIFT
#undef MAX_EMPTY_BLOCKS
#undef BLOCK_ALLOC_FILL_PAGES
#undef PTR_HASH_ALLOC_FILL_PAGES
#undef PTR_HASH_ALLOC_FIXED_FILL_PAGES
/* Note: The block_alloc mutex is held while PRE_INIT_BLOCK runs. */
#define PRE_INIT_BLOCK(X)
#define INIT_BLOCK(X)
#define EXIT_BLOCK(X)
#define COUNT_BLOCK(X)
#define COUNT_OTHER()
#define BLOCK_ALLOC_HSIZE_SHIFT 2
#define MAX_EMPTY_BLOCKS 4
#ifndef BLOCK_ALLOC_USED
#define BLOCK_ALLOC_USED DO_IF_DMALLOC(real_used) DO_IF_NOT_DMALLOC(used)
#endif
/* Invalidate the block as far as possible if running with dmalloc.
*/
#define DO_PRE_INIT_BLOCK(X) do { \
DO_IF_DMALLOC(MEMSET((X), 0x55, sizeof(*(X)))); \
PRE_INIT_BLOCK(X); \
} while (0)
#ifndef PIKE_HASH_T
#define PIKE_HASH_T size_t
#endif /* !PIKE_HASH_T */
#ifdef PIKE_RUN_UNLOCKED
#include "threads.h"
/* 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
#define BLOCK_ALLOC_FILL_PAGES(DATA, PAGES) \
BLOCK_ALLOC(DATA, \
((PIKE_MALLOC_PAGE_SIZE * (PAGES)) \
- PIKE_MALLOC_OVERHEAD - BLOCK_HEADER_SIZE) / \
sizeof (struct DATA))
#define PTR_HASH_ALLOC_FILL_PAGES(DATA, PAGES) \
PTR_HASH_ALLOC(DATA, \
((PIKE_MALLOC_PAGE_SIZE * (PAGES)) \
- PIKE_MALLOC_OVERHEAD - BLOCK_HEADER_SIZE) / \