aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memory.h
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-01-07 23:13:57 +0100
committerGitHub <noreply@github.com>2017-01-07 23:13:57 +0100
commit50af8e0255c0271ff411a6af54b664d69be227e5 (patch)
tree50260092952a0d236a25d70a4aed16fa6363c6e2 /src/nvim/memory.h
parent40c76741c187f5bf35101e65252226030d5b72e5 (diff)
parent3967618fa524b3840649887661584de27f7daa87 (diff)
downloadrneovim-50af8e0255c0271ff411a6af54b664d69be227e5.tar.gz
rneovim-50af8e0255c0271ff411a6af54b664d69be227e5.tar.bz2
rneovim-50af8e0255c0271ff411a6af54b664d69be227e5.zip
Merge #5903 from ZyX-I/fix-5901
Reset copyID also when dictionary is referenced
Diffstat (limited to 'src/nvim/memory.h')
-rw-r--r--src/nvim/memory.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/nvim/memory.h b/src/nvim/memory.h
index 62cc78360c..250ac3e08f 100644
--- a/src/nvim/memory.h
+++ b/src/nvim/memory.h
@@ -1,9 +1,41 @@
#ifndef NVIM_MEMORY_H
#define NVIM_MEMORY_H
+#include <stdbool.h> // for bool
#include <stdint.h> // for uint8_t
#include <stddef.h> // for size_t
-#include <time.h> // for time_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
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "memory.h.generated.h"