aboutsummaryrefslogtreecommitdiff
path: root/src/memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory.h')
-rw-r--r--src/memory.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/memory.h b/src/memory.h
index 723e7af814..0249b19464 100644
--- a/src/memory.h
+++ b/src/memory.h
@@ -127,6 +127,22 @@ char *xstpcpy(char *restrict dst, const char *restrict src);
/// @param maxlen
char *xstpncpy(char *restrict dst, const char *restrict src, size_t maxlen);
+/// Duplicates a chunk of memory using xmalloc
+///
+/// @see {xmalloc}
+/// @param data pointer to the chunk
+/// @param len size of the chunk
+/// @return a pointer
+char *xmemdup(const char *data, size_t len)
+ FUNC_ATTR_MALLOC FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_RET;
+
+/// Old low level memory allocation function.
+///
+/// @deprecated use xmalloc() directly instead
+/// @param size
+/// @return pointer to allocated space. Never NULL
+char_u *lalloc(long_u size, int message) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1);
+
void do_outofmem_msg(long_u size);
void free_all_mem(void);