aboutsummaryrefslogtreecommitdiff
path: root/src/memory.c
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.c
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.c')
-rw-r--r--src/memory.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/memory.c b/src/memory.c
index 5bc23284dc..53214d5265 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -214,6 +214,10 @@ char *xstrndup(const char *str, size_t len)
return xmemdupz(str, p ? (size_t)(p - str) : len);
}
+char *xmemdup(const char *data, size_t len)
+{
+ return memcpy(xmalloc(len), data, len);
+}
/*
* Avoid repeating the error message many times (they take 1 second each).