Skip to content

Commit a77e8ad

Browse files
committed
don't calloc unnecessairily
1 parent 9063d00 commit a77e8ad

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

include/mimalloc/profile.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ typedef struct mi_heap_s mi_heap_t;
2929
// `user_data` — flexible array member for caller-owned metadata
3030
// (e.g. a captured stack trace). The number of bytes
3131
// available is _mi_profiler.record_extra_bytes, set at
32-
// mi_profiler_enable() time. The profiler zeroes this
33-
// region when the record is allocated and never reads it.
32+
// mi_profiler_enable() time. The profiler does not
33+
// initialize this region and never reads it.
3434
// ------------------------------------------------------------------
3535
typedef struct mi_alloc_record_s {
3636
void* ptr;

src/profile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ void mi_profiler_enable(size_t initial_threshold, size_t record_extra_bytes,
7777
// Record memory management
7878
//
7979
// Each record is sizeof(mi_alloc_record_t) + record_extra_bytes bytes.
80-
// The extra bytes are zeroed by _mi_heap_malloc_zero and available to
81-
// the callback via record->user_data[].
80+
// The extra bytes are available to the callback via record->user_data[]
81+
// but are not initialized; the callback must set any fields it will read.
8282
//
8383
// Records are allocated from the same mimalloc heap as the sampled
8484
// object by calling _mi_heap_malloc_zero from inside the allocator.

0 commit comments

Comments
 (0)