Skip to content

Commit

Permalink
Remove inline from khash_python (#57618)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd authored Feb 26, 2024
1 parent 9530851 commit edd45f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pandas/_libs/include/pandas/vendored/klib/khash_python.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ typedef struct {
} khcomplex128_t;

static const int KHASH_TRACE_DOMAIN = 424242;
static inline void *traced_malloc(size_t size) {
static void *traced_malloc(size_t size) {
void *ptr = malloc(size);
if (ptr != NULL) {
PyTraceMalloc_Track(KHASH_TRACE_DOMAIN, (uintptr_t)ptr, size);
}
return ptr;
}

static inline void *traced_calloc(size_t num, size_t size) {
static void *traced_calloc(size_t num, size_t size) {
void *ptr = calloc(num, size);
if (ptr != NULL) {
PyTraceMalloc_Track(KHASH_TRACE_DOMAIN, (uintptr_t)ptr, num * size);
}
return ptr;
}

static inline void *traced_realloc(void *old_ptr, size_t size) {
static void *traced_realloc(void *old_ptr, size_t size) {
void *ptr = realloc(old_ptr, size);
if (ptr != NULL) {
if (old_ptr != ptr) {
Expand All @@ -43,7 +43,7 @@ static inline void *traced_realloc(void *old_ptr, size_t size) {
return ptr;
}

static inline void traced_free(void *ptr) {
static void traced_free(void *ptr) {
if (ptr != NULL) {
PyTraceMalloc_Untrack(KHASH_TRACE_DOMAIN, (uintptr_t)ptr);
}
Expand Down

0 comments on commit edd45f6

Please sign in to comment.