Skip to content

Commit

Permalink
Do not include zmalloc into sds.c
Browse files Browse the repository at this point in the history
Instead of zmalloc_size use s_malloc_size.

Signed-off-by: Vadym Khoptynets <[email protected]>
  • Loading branch information
poiuj committed Jun 3, 2024
1 parent 2310767 commit 37ad930
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sds.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "sds.h"
#include "sdsalloc.h"
#include "util.h"
#include "zmalloc.h"

const char *SDS_NOINIT = "SDS_NOINIT";

Expand Down Expand Up @@ -416,7 +415,7 @@ size_t sdsAllocSize(sds s) {
char type = s[-1] & SDS_TYPE_MASK;
/* SDS_TYPE_5 header doesn't contain the size of the allocation */
if (type == SDS_TYPE_5) {
return zmalloc_size(sdsAllocPtr(s));
return s_malloc_size(sdsAllocPtr(s));
} else {
return sdsHdrSize(type) + sdsalloc(s) + 1;
}
Expand Down

0 comments on commit 37ad930

Please sign in to comment.