Branch: Tag:

2021-09-23

2021-09-23 09:25:11 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Runtime: Register strings --with-dmalloc.

With the switch to the new block allocator the registering of
strings with debug malloc was lost. Now it is back again.

541:   static void free_unlinked_pike_string(struct pike_string * s)   {    free_string_content(s); +  dmalloc_unregister(s, 0);    switch(s->struct_type)    {    case STRING_STRUCT_STRING:
669: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    gc_init_marker(t);   #endif +  dmalloc_register(t, sizeof(struct pike_string), DMALLOC_LOCATION());    t->flags = STRING_NOT_HASHED|STRING_NOT_SHARED;    t->alloc_type = STRING_ALLOC_STATIC;    t->struct_type = STRING_STRUCT_STRING;
701: Inside #if defined(PIKE_DEBUG)
   Pike_fatal("Static string \"%.*s\" is not NUL-terminated!\n", len, str);    }   #endif +  dmalloc_register(t, sizeof(struct pike_string), DMALLOC_LOCATION());    t->flags = STRING_NOT_HASHED|STRING_NOT_SHARED;    t->size_shift = shift;    t->alloc_type = STRING_ALLOC_STATIC;
759: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    gc_init_marker(s);   #endif +  dmalloc_register(s, sizeof(struct pike_string), DMALLOC_LOCATION());       s->flags = STRING_NOT_HASHED|STRING_NOT_SHARED;    s->size_shift = shift;
1903: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    gc_init_marker(&res->str);   #endif +  dmalloc_register(res, sizeof(struct substring_pike_string), DMALLOC_LOCATION());    res->parent = s;    s->flags |= STRING_IS_LOCKED; /* Make sure the string data isn't reallocated. */    add_ref(s);