Skip to content

Commit

Permalink
Update zfree_internal docstring and add assert
Browse files Browse the repository at this point in the history
Signed-off-by: Vadym Khoptynets <[email protected]>
  • Loading branch information
poiuj committed Jun 13, 2024
1 parent 2f96c40 commit 19f8f36
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/zmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,11 @@ size_t zmalloc_usable_size(void *ptr) {
/* Frees the memory buffer pointed by ptr and updates statistics. When using
* jemalloc it uses the fast track by specifying the buffer size.
*
* ptr must point to the start of the buffer. On systems where we have the
* additional header with size, the caller must do the necessary adjustments to
* ptr. ptr must not be NULL. The caller is responsible to provide the real
* allocaction size. */
* ptr must point to the start of the buffer. It must have been returned by a
* previous call to the system allocator. ptr must not be NULL. The caller is
* responsible to provide the real allocaction size. */
static inline void zfree_internal(void *ptr, size_t size) {
assert(ptr != NULL);
update_zmalloc_stat_free(size);

#ifdef USE_JEMALLOC
Expand Down

0 comments on commit 19f8f36

Please sign in to comment.