refactor: make two functions used only in memory.c static (#34339)

After #29450 try_to_free_memory() is only used in memory.c.
Also move do_outofmem_msg() closer to where it's used.
This commit is contained in:
zeertzjq
2025-06-06 13:49:22 +08:00
committed by GitHub
parent 60d0b7d0c3
commit 9f505b4d0f
2 changed files with 23 additions and 24 deletions

View File

@@ -21,10 +21,6 @@ typedef void *(*MemCalloc)(size_t, size_t);
/// `realloc()` function signature
typedef void *(*MemRealloc)(void *, size_t);
typedef void *(*MergeSortGetFunc)(void *);
typedef void (*MergeSortSetFunc)(void *, void *);
typedef int (*MergeSortCompareFunc)(const void *, const void *);
#ifdef UNIT_TESTING
/// When unit testing: pointer to the `malloc()` function, may be altered
extern MemMalloc mem_malloc;
@@ -44,6 +40,10 @@ extern MemRealloc mem_realloc;
extern bool entered_free_all_mem;
#endif
typedef void *(*MergeSortGetFunc)(void *);
typedef void (*MergeSortSetFunc)(void *, void *);
typedef int (*MergeSortCompareFunc)(const void *, const void *);
EXTERN size_t arena_alloc_count INIT( = 0);
#define kv_fixsize_arena(a, v, s) \