aboutsummaryrefslogtreecommitdiff
path: root/src/memory.h
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-05-07 17:59:57 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-05-12 19:28:30 -0300
commitf9c06e47c4c672fb5f07968dd2d536fa41c1f007 (patch)
tree5159e70c844b2679bbbe221101e3160971f9d525 /src/memory.h
parentb3268d071277c8967b3e3ecb60430718e1f36472 (diff)
downloadrneovim-f9c06e47c4c672fb5f07968dd2d536fa41c1f007.tar.gz
rneovim-f9c06e47c4c672fb5f07968dd2d536fa41c1f007.tar.bz2
rneovim-f9c06e47c4c672fb5f07968dd2d536fa41c1f007.zip
Add channel module
- Add channel module that exposes the API over arbitrary streams - Add `xmemdup` for duplicating memory chunks - Make job exit callback optional
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);