pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:70:      /*    * Flags used as flag_method to mk_type()    */   #define PT_COPY_CAR 1   #define PT_COPY_CDR 2   #define PT_COPY_BOTH 3   #define PT_IS_MARKER 4 /* The node is a marker. */      /* Number of entries in the struct pike_type hash-table. */ - #define PIKE_TYPE_HASH_SIZE 65535 + /* 256Kb */ + #define PIKE_TYPE_HASH_SIZE 32767    -  +    #ifdef PIKE_TYPE_DEBUG   static int indent=0;   #endif      int max_correct_args;      PMOD_EXPORT struct pike_type *string0_type_string;   PMOD_EXPORT struct pike_type *string_type_string;   PMOD_EXPORT struct pike_type *int_type_string;   PMOD_EXPORT struct pike_type *float_type_string;
pike.git/src/pike_types.c:8615:      void init_types(void)   {    /* Initialize hashtable here. */    pike_type_hash = xcalloc(sizeof(struct pike_type *),    (PIKE_TYPE_HASH_SIZE+1));    pike_type_hash_size = PIKE_TYPE_HASH_SIZE;       /* if possible, use mmap with on-demand allocation */   #if defined(MAP_ANONYMOUS) + #ifndef MAP_NORESERVE + #define MAP_NORESERVE 0 + #endif    type_stack = mmap( NULL, sizeof(struct pike_type *)*PIKE_TYPE_STACK_SIZE, -  PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); +  PROT_READ|PROT_WRITE, MAP_NORESERVE|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);    if( type_stack != MAP_FAILED ) {    type_stack_mmap = 1;    } else {    type_stack = NULL;    }    pike_type_mark_stack =    mmap( NULL, sizeof(struct pike_type **)*PIKE_TYPE_STACK_SIZE>>2, -  PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); +  PROT_READ|PROT_WRITE, MAP_NORESERVE|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);    if( pike_type_mark_stack != MAP_FAILED ) {    pike_type_mark_stack_mmap = 1;    } else {    pike_type_mark_stack = NULL;    }   #endif    if( !type_stack )    type_stack = xalloc(sizeof(struct pike_type *)*PIKE_TYPE_STACK_SIZE);    if( !pike_type_mark_stack )    pike_type_mark_stack = xalloc(sizeof(struct pike_type *)*PIKE_TYPE_STACK_SIZE / 4);