Lines Matching refs:size

43 // keep a list of unique caller:size sites in a list
50 size_t size;
62 void add_stat(void* caller, size_t size) {
72 if (s->caller == caller && s->size == size) {
86 s->size = size;
103 // reinsert all of the entries, sorted by size
107 if (stats[i].size >= s->size) {
121 printf("size %8zu count %8" PRIu64 " caller %p\n", s->size, s->count, s->caller);
139 void* malloc(size_t size) {
142 LTRACEF("size %zu\n", size);
144 add_stat(__GET_CALLER(), size);
146 void* ptr = cmpct_alloc(size);
148 printf("caller %p malloc %zu -> %p\n", __GET_CALLER(), size, ptr);
152 panic("malloc of size %zu failed\n", size);
158 void* malloc_debug_caller_(size_t size, void* caller) {
161 LTRACEF("size %zu\n", size);
163 add_stat(caller, size);
165 void* ptr = cmpct_alloc(size);
167 printf("caller %p malloc %zu -> %p\n", caller, size, ptr);
171 panic("malloc of size %zu failed\n", size);
177 void* memalign(size_t boundary, size_t size) {
180 LTRACEF("boundary %zu, size %zu\n", boundary, size);
182 add_stat(__GET_CALLER(), size);
184 void* ptr = cmpct_memalign(size, boundary);
186 printf("caller %p memalign %zu, %zu -> %p\n", __GET_CALLER(), boundary, size, ptr);
190 panic("memalign of size %zu align %zu failed\n", size, boundary);
196 void* calloc(size_t count, size_t size) {
199 LTRACEF("count %zu, size %zu\n", count, size);
201 add_stat(__GET_CALLER(), size);
203 size_t realsize = count * size;
210 printf("caller %p calloc %zu, %zu -> %p\n", __GET_CALLER(), count, size, ptr);
215 void* realloc(void* ptr, size_t size) {
218 LTRACEF("ptr %p, size %zu\n", ptr, size);
220 add_stat(__GET_CALLER(), size);
222 void* ptr2 = cmpct_realloc(ptr, size);
224 printf("caller %p realloc %p, %zu -> %p\n", __GET_CALLER(), ptr, size, ptr2);
228 panic("realloc of size %zu old ptr %p failed\n", size, ptr);