Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
pycore_obmalloc_init.h67 linesDownload Raw Back to internal
1#ifndef Py_INTERNAL_OBMALLOC_INIT_H2#define Py_INTERNAL_OBMALLOC_INIT_H3#ifdef __cplusplus4extern "C" {5#endif6 7#ifndef Py_BUILD_CORE8#  error "this header requires Py_BUILD_CORE define"9#endif10 11 12/****************************************************/13/* the default object allocator's state initializer */14 15#define PTA(pools, x) \16    ((poolp )((uint8_t *)&(pools.used[2*(x)]) - 2*sizeof(pymem_block *)))17#define PT(p, x)   PTA(p, x), PTA(p, x)18 19#define PT_8(p, start) \20    PT(p, start), \21    PT(p, start+1), \22    PT(p, start+2), \23    PT(p, start+3), \24    PT(p, start+4), \25    PT(p, start+5), \26    PT(p, start+6), \27    PT(p, start+7)28 29#if NB_SMALL_SIZE_CLASSES <= 830#  define _obmalloc_pools_INIT(p) \31    { PT_8(p, 0) }32#elif NB_SMALL_SIZE_CLASSES <= 1633#  define _obmalloc_pools_INIT(p) \34    { PT_8(p, 0), PT_8(p, 8) }35#elif NB_SMALL_SIZE_CLASSES <= 2436#  define _obmalloc_pools_INIT(p) \37    { PT_8(p, 0), PT_8(p, 8), PT_8(p, 16) }38#elif NB_SMALL_SIZE_CLASSES <= 3239#  define _obmalloc_pools_INIT(p) \40    { PT_8(p, 0), PT_8(p, 8), PT_8(p, 16), PT_8(p, 24) }41#elif NB_SMALL_SIZE_CLASSES <= 4042#  define _obmalloc_pools_INIT(p) \43    { PT_8(p, 0), PT_8(p, 8), PT_8(p, 16), PT_8(p, 24), PT_8(p, 32) }44#elif NB_SMALL_SIZE_CLASSES <= 4845#  define _obmalloc_pools_INIT(p) \46    { PT_8(p, 0), PT_8(p, 8), PT_8(p, 16), PT_8(p, 24), PT_8(p, 32), PT_8(p, 40) }47#elif NB_SMALL_SIZE_CLASSES <= 5648#  define _obmalloc_pools_INIT(p) \49    { PT_8(p, 0), PT_8(p, 8), PT_8(p, 16), PT_8(p, 24), PT_8(p, 32), PT_8(p, 40), PT_8(p, 48) }50#elif NB_SMALL_SIZE_CLASSES <= 6451#  define _obmalloc_pools_INIT(p) \52    { PT_8(p, 0), PT_8(p, 8), PT_8(p, 16), PT_8(p, 24), PT_8(p, 32), PT_8(p, 40), PT_8(p, 48), PT_8(p, 56) }53#else54#  error "NB_SMALL_SIZE_CLASSES should be less than 64"55#endif56 57#define _obmalloc_global_state_INIT \58    { \59        .dump_debug_stats = -1, \60    }61 62 63#ifdef __cplusplus64}65#endif66#endif  // !Py_INTERNAL_OBMALLOC_INIT_H67 
codekingpro/portable-devtools · Team Ai