Browse Source

note that we do not want hidden malloc aliases

We want to let malloc() and friends be overridable at runtime so that apps
can insert their own implementation (think debugging, specialized setups,
etc...).  That means that C library functions that return allocated memory
have to go through the normal malloc() symbol as well as the external code
is the one who will be calling free().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Mike Frysinger 15 years ago
parent
commit
89753413b2
1 changed files with 2 additions and 0 deletions
  1. 2 0
      include/stdlib.h

+ 2 - 0
include/stdlib.h

@@ -482,6 +482,8 @@ extern int lcong48_r (unsigned short int __param[7],
 __BEGIN_NAMESPACE_STD
 /* Allocate SIZE bytes of memory.  */
 extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
+/* We want the malloc symbols overridable at runtime
+ * libc_hidden_proto(malloc) */
 /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0.  */
 extern void *calloc (size_t __nmemb, size_t __size)
      __THROW __attribute_malloc__ __wur;