pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:615:       base_table=(struct pike_string **)xalloc(sizeof(struct pike_string *)*htable_size);    MEMSET((char *)base_table,0,sizeof(struct pike_string *)*htable_size);       need_more_hash_prefix_depth = 0;       for(h=0;h<old;h++)    rehash_string_backwards(old_base[h]);       if(old_base) -  free((char *)old_base); +  free(old_base);      #ifdef PIKE_RUN_UNLOCKED    for(h=0;h<BUCKET_LOCKS;h++) mt_unlock(bucket_locks + h);   #endif   }      /* Allocation of strings */      /* Without the str at the end, to get the size of the header. */   struct pike_string_hdr {
pike.git/src/stralloc.c:646:    PIKE_STRING_CONTENTS;    p_wchar0 str[SHORT_STRING_THRESHOLD+1];   };      static struct block_allocator string_allocator = BA_INIT(sizeof(struct short_pike_string0), SHORT_STRING_BLOCK);      #define free_unlinked_pike_string(s) do { \    if (s->flags & STRING_IS_SHORT) { \    ba_free(&string_allocator, s); \    } else { \ -  debug_free((char *)s, DMALLOC_LOCATION(), 1); \ +  debug_free(s, DMALLOC_LOCATION(), 1); \    } \    } while(0)      /* note that begin_shared_string expects the _exact_ size of the string,    * not the maximum size    */   PMOD_EXPORT struct pike_string *debug_begin_shared_string(size_t len)   {    struct pike_string *t;   #ifdef PIKE_DEBUG
pike.git/src/stralloc.c:2286: Inside #if defined(REALLY_FREE)
   next=s->next;   #ifdef REALLY_FREE    free_unlinked_pike_string(s);   #else    s->next=0;   #endif    }    base_table[e]=0;    UNLOCK_BUCKET(e);    } -  free((char *)base_table); +  free(base_table);    base_table=0;    num_strings=0;      #ifdef DO_PIKE_CLEANUP    ba_destroy(&string_allocator);   #endif /* DO_PIKE_CLEANUP */   }      static INLINE size_t memory_in_string (struct pike_string *s)   {