summaryrefslogtreecommitdiff
path: root/extra/yassl/taocrypt/test/memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'extra/yassl/taocrypt/test/memory.cpp')
-rw-r--r--extra/yassl/taocrypt/test/memory.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/extra/yassl/taocrypt/test/memory.cpp b/extra/yassl/taocrypt/test/memory.cpp
index a879a497800..33bf523565e 100644
--- a/extra/yassl/taocrypt/test/memory.cpp
+++ b/extra/yassl/taocrypt/test/memory.cpp
@@ -310,3 +310,32 @@ void operator delete[](void* ptr)
{
::operator delete(ptr);
}
+
+
+extern "C" {
+
+void* XMALLOC(size_t sz, void* head)
+{
+ return ::operator new(sz);
+}
+
+void* XREALLOC(void* ptr, size_t sz, void* heap)
+{
+ void* ret = ::operator new(sz);
+
+ if (ret && ptr)
+ memcpy(ret, ptr, sz);
+
+ if (ret)
+ ::operator delete(ptr);
+ return ret;
+}
+
+
+void XFREE(void* ptr, void* heap)
+{
+ ::operator delete(ptr);
+}
+
+} // extern "C"
+