summaryrefslogtreecommitdiff
path: root/libgcompat
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2018-01-14 21:39:28 -0600
committerSamuel Holland <samuel@sholland.org>2018-01-14 21:39:28 -0600
commit9549bf6ab9feddec4959de21d3e1a1f59adb15a5 (patch)
treef5c36c07a6eeb1b375cf330c24900336530655a4 /libgcompat
parentd0fc6cbef513341ff6b3d12c9b9a1e4093c0a112 (diff)
downloadgcompat-9549bf6ab9feddec4959de21d3e1a1f59adb15a5.tar.gz
gcompat-9549bf6ab9feddec4959de21d3e1a1f59adb15a5.tar.bz2
gcompat-9549bf6ab9feddec4959de21d3e1a1f59adb15a5.tar.xz
gcompat-9549bf6ab9feddec4959de21d3e1a1f59adb15a5.zip
malloc: Sort functions by name
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'libgcompat')
-rw-r--r--libgcompat/malloc.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/libgcompat/malloc.c b/libgcompat/malloc.c
index dc9d25e..14fbf66 100644
--- a/libgcompat/malloc.c
+++ b/libgcompat/malloc.c
@@ -1,4 +1,5 @@
-/* struct mallinfo pulled from mallinfo.3:
+/*
+ * struct mallinfo pulled from mallinfo.3:
*
* Copyright (c) 2012 by Michael Kerrisk <mtk.manpages@gmail.com>
*
@@ -42,30 +43,29 @@ struct mallinfo {
int keepcost; /* Top-most, releasable space (bytes) */
};
-struct mallinfo mallinfo(void)
+void *__libc_calloc(size_t nmemb, size_t size)
{
- struct mallinfo my_info;
- memset(&my_info, 0, sizeof(struct mallinfo));
- return my_info;
+ return calloc(nmemb, size);
}
+alias(__libc_calloc, __calloc);
-void *__libc_malloc(size_t size)
+void __libc_free(void *ptr)
{
- return malloc(size);
+ free(ptr);
}
-alias(__libc_malloc, __malloc);
+alias(__libc_free, __free);
-void __libc_free(void *ptr)
+void *__libc_malloc(size_t size)
{
- return free(ptr);
+ return malloc(size);
}
-alias(__libc_free, __free);
+alias(__libc_malloc, __malloc);
-void *__libc_calloc(size_t nmemb, size_t size)
+void *__libc_memalign(size_t align, size_t len)
{
- return calloc(nmemb, size);
+ return memalign(align, len);
}
-alias(__libc_calloc, __calloc);
+alias(__libc_memalign, __memalign);
void *__libc_realloc(void *ptr, size_t size)
{
@@ -73,7 +73,9 @@ void *__libc_realloc(void *ptr, size_t size)
}
alias(__libc_realloc, __realloc);
-void *__libc_memalign(size_t align, size_t len)
+struct mallinfo mallinfo(void)
{
- return memalign(align, len);
+ struct mallinfo info;
+ memset(&info, 0, sizeof(info));
+ return info;
}