From: Waldemar Kozaczuk <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master

libc: add reallocarray

Some apps like xclock from Fedora need reallocarray() which
this patch adds as simple delegation to realloc.

Signed-off-by: Waldemar Kozaczuk <[email protected]>

---
diff --git a/core/mempool.cc b/core/mempool.cc
--- a/core/mempool.cc
+++ b/core/mempool.cc
@@ -2014,6 +2014,11 @@ void* realloc(void* obj, size_t size)
     return buf;
 }
 
+extern "C" void *reallocarray(void *ptr, size_t nmemb, size_t size)
+{
+    return realloc(ptr, nmemb * size);
+}
+
 size_t malloc_usable_size(void* obj)
 {
     if ( obj == nullptr ) {

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/0000000000009e380e05a4c5ea64%40google.com.

Reply via email to