add ef posix_memalign function 19/5219/1
authorHanoh Haim <[email protected]>
Tue, 27 Dec 2016 07:32:25 +0000 (09:32 +0200)
committerHanoh Haim <[email protected]>
Tue, 27 Dec 2016 07:32:39 +0000 (09:32 +0200)
Signed-off-by: Hanoh Haim <[email protected]>
src/common/ef/efence.cpp

index 1340a12..b74d3da 100644 (file)
@@ -821,7 +821,6 @@ ef_malloc(size_t size)
 
     lock();
     allocation=ef_memalign(EF_ALIGNMENT, size); 
-
     /* put 0xaa into the memset to find uninit issues */
     memset(allocation,0xaa,size);
     #if 0
@@ -897,6 +896,14 @@ calloc(size_t nelem, size_t elsize)
     return (ef_calloc(nelem, elsize));
 }
 
+extern C_LINKAGE int
+posix_memalign(void **memptr, size_t alignment, size_t size)
+{
+    *memptr=ef_malloc(size);
+    return(0);
+}
+
+
 /*
  * This will catch more bugs if you remove the page alignment, but it
  * will break some software.