mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
memory: Document new additions to memory.h
This commit is contained in:
parent
35416e89bc
commit
6f267b3968
@ -49,7 +49,6 @@ MemRealloc mem_realloc = &realloc;
|
||||
#endif
|
||||
|
||||
#ifdef EXITFREE
|
||||
/// Indicates that free_all_mem function was or is running
|
||||
bool entered_free_all_mem = false;
|
||||
#endif
|
||||
|
||||
|
@ -5,17 +5,34 @@
|
||||
#include <stddef.h> // for size_t
|
||||
#include <time.h> // for time_t
|
||||
|
||||
/// `malloc()` function signature
|
||||
typedef void *(*MemMalloc)(size_t);
|
||||
|
||||
/// `free()` function signature
|
||||
typedef void (*MemFree)(void *);
|
||||
|
||||
/// `calloc()` function signature
|
||||
typedef void *(*MemCalloc)(size_t, size_t);
|
||||
|
||||
/// `realloc()` function signature
|
||||
typedef void *(*MemRealloc)(void *, size_t);
|
||||
|
||||
#ifdef UNIT_TESTING
|
||||
/// When unit testing: pointer to the `malloc()` function, may be altered
|
||||
extern MemMalloc mem_malloc;
|
||||
|
||||
/// When unit testing: pointer to the `free()` function, may be altered
|
||||
extern MemFree mem_free;
|
||||
|
||||
/// When unit testing: pointer to the `calloc()` function, may be altered
|
||||
extern MemCalloc mem_calloc;
|
||||
|
||||
/// When unit testing: pointer to the `realloc()` function, may be altered
|
||||
extern MemRealloc mem_realloc;
|
||||
#endif
|
||||
|
||||
#ifdef EXITFREE
|
||||
/// Indicates that free_all_mem function was or is running
|
||||
extern bool entered_free_all_mem;
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user