Skip to content

Commit

Permalink
pack: Replace sdsalloc.h with alloc.h (#159)
Browse files Browse the repository at this point in the history
Fixes #158.

* src/pack.c: Replace sdsalloc.h with alloc.h.
(pack_command): Replace s_malloc with hi_malloc.
  • Loading branch information
Apteryks committed Jul 11, 2024
1 parent e70af5b commit f4dd081
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extern sds sdscpylen(sds s, const char *t, size_t len);
extern sds sdsnewlen(const void *init, size_t initlen);
#endif

#include <hiredis/sdsalloc.h>
#include <hiredis/alloc.h>

PyObject *
pack_command(PyObject *cmd)
Expand All @@ -32,7 +32,7 @@ pack_command(PyObject *cmd)
}

Py_ssize_t tokens_number = PyTuple_Size(cmd);
sds *tokens = s_malloc(sizeof(sds) * tokens_number);
sds *tokens = hi_malloc(sizeof(sds) * tokens_number);
if (tokens == NULL)
{
return PyErr_NoMemory();
Expand Down Expand Up @@ -118,4 +118,4 @@ pack_command(PyObject *cmd)
sdsfreesplitres(tokens, tokens_number);
hi_free(lengths);
return result;
}
}

0 comments on commit f4dd081

Please sign in to comment.