pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:101:   PMOD_EXPORT struct pike_type *void_type_string;   PMOD_EXPORT struct pike_type *zero_type_string;   PMOD_EXPORT struct pike_type *inheritable_type_string;   PMOD_EXPORT struct pike_type *typeable_type_string;   PMOD_EXPORT struct pike_type *enumerable_type_string;   PMOD_EXPORT struct pike_type *any_type_string;   PMOD_EXPORT struct pike_type *weak_type_string; /* array|mapping|multiset|function */   struct pike_type *sscanf_type_string;   struct pike_type *sscanf_76_type_string;    + PMOD_EXPORT struct pike_string *literal_string_string; + PMOD_EXPORT struct pike_string *literal_int_string; + PMOD_EXPORT struct pike_string *literal_float_string; + PMOD_EXPORT struct pike_string *literal_function_string; + PMOD_EXPORT struct pike_string *literal_object_string; + PMOD_EXPORT struct pike_string *literal_program_string; + PMOD_EXPORT struct pike_string *literal_array_string; + PMOD_EXPORT struct pike_string *literal_multiset_string; + PMOD_EXPORT struct pike_string *literal_mapping_string; + PMOD_EXPORT struct pike_string *literal_type_string; + PMOD_EXPORT struct pike_string *literal_mixed_string; +  +    #ifdef DO_PIKE_CLEANUP   struct pike_type_location *all_pike_type_locations = NULL;   #endif /* DO_PIKE_CLEANUP */      static struct pike_type *a_markers[10], *b_markers[10];      static struct program *implements_a;   static struct program *implements_b;   static int implements_mode;   
pike.git/src/pike_types.c:281:    * a many argument just have a MANY node, and no FUNCTION node.    *    */   static struct block_allocator type_allocator = BA_INIT(sizeof(struct pike_type), 128);      PMOD_EXPORT void really_free_pike_type(struct pike_type * t) {    ba_free(&type_allocator, t);   }      ATTRIBUTE((malloc)) - PMOD_EXPORT struct pike_type * alloc_pike_type() { + PMOD_EXPORT struct pike_type * alloc_pike_type(void) {    return ba_alloc(&type_allocator);   }      PMOD_EXPORT void count_memory_in_pike_types(size_t *n, size_t *s) {    ba_count_all(&type_allocator, n, s);   }      struct pike_type **pike_type_hash = NULL;   size_t pike_type_hash_size = 0;   
pike.git/src/pike_types.c:8449: Inside #if defined(PIKE_DEBUG)
   }   #ifdef PIKE_DEBUG    default:    Pike_fatal("compile_type_string(): Error in type string %d.\n", type);    /* NOT_REACHED */    break;   #endif    }   }    - void type_stack_mark() + void type_stack_mark(void)   {    if(UNLIKELY(Pike_compiler->pike_type_mark_stackp >= pike_type_mark_stack + (PIKE_TYPE_STACK_SIZE>>4)))    Pike_fatal("Type mark stack overflow.\n");    *Pike_compiler->pike_type_mark_stackp=Pike_compiler->type_stackp;    Pike_compiler->pike_type_mark_stackp++;    TYPE_STACK_DEBUG("type_stack_mark");   }      /* Make a pike-type from a serialized (old-style) type. */   struct pike_type *debug_make_pike_type(const char *serialized_type)
pike.git/src/pike_types.c:8762:    enumerable_type_string = CONSTTYPE(tOr3(tString,tInt,tFloat));    any_type_string = CONSTTYPE(tOr(tVoid,tMix));    weak_type_string = CONSTTYPE(tOr4(tArray,tMultiset,tMapping,    tFuncV(tNone,tZero,tOr(tMix,tVoid))));    sscanf_type_string = CONSTTYPE(tFuncV(tStr tAttr("sscanf_format", tStr),    tAttr("sscanf_args", tMix), tIntPos));    sscanf_76_type_string = CONSTTYPE(tFuncV(tStr tAttr("sscanf_76_format", tStr),    tAttr("sscanf_args", tMix), tIntPos));    /* add_ref(weak_type_string); *//* LEAK */    +  literal_string_string = make_shared_string("string"); +  literal_int_string = make_shared_string("int"); +  literal_float_string = make_shared_string("float"); +  literal_function_string = make_shared_string("function"); +  literal_object_string = make_shared_string("object"); +  literal_program_string = make_shared_string("program"); +  literal_array_string = make_shared_string("array"); +  literal_multiset_string = make_shared_string("multiset"); +  literal_mapping_string = make_shared_string("mapping"); +  literal_type_string = make_shared_string("type"); +  literal_mixed_string = make_shared_string("mixed"); +    #ifdef PIKE_DEBUG    pike_type_gc_callback = add_gc_callback(gc_mark_external_types, NULL, NULL);   #endif   }      void cleanup_pike_types(void)   {   #ifdef DO_PIKE_CLEANUP    while (all_pike_type_locations) {    free_type(all_pike_type_locations->t);
pike.git/src/pike_types.c:8834:    free_type(enumerable_type_string);    enumerable_type_string = NULL;    free_type(any_type_string);    any_type_string = NULL;    free_type(weak_type_string);    weak_type_string = NULL;    free_type(sscanf_type_string);    sscanf_type_string = NULL;    free_type(sscanf_76_type_string);    sscanf_76_type_string = NULL; +  +  free_string(literal_string_string); literal_string_string = NULL; +  free_string(literal_int_string); literal_int_string = NULL; +  free_string(literal_float_string); literal_float_string = NULL; +  free_string(literal_function_string); literal_function_string = NULL; +  free_string(literal_object_string); literal_object_string = NULL; +  free_string(literal_program_string); literal_program_string = NULL; +  free_string(literal_array_string); literal_array_string = NULL; +  free_string(literal_multiset_string); literal_multiset_string = NULL; +  free_string(literal_mapping_string); literal_mapping_string = NULL; +  free_string(literal_type_string); literal_type_string = NULL; +  free_string(literal_mixed_string); literal_mixed_string = NULL; +    #ifdef PIKE_DEBUG    remove_callback(pike_type_gc_callback);   #endif   }      void cleanup_pike_type_table(void)   {    /* Free the hashtable here. */    if (pike_type_hash) {    free(pike_type_hash);