|
|
147e83 |
commit c13a72b7c4864f23b9f2e96a3369e5875ed3b51b
|
|
|
147e83 |
Author: Will Newton <will.newton@linaro.org>
|
|
|
147e83 |
Date: Thu Feb 6 08:54:20 2014 +0000
|
|
|
147e83 |
|
|
|
147e83 |
malloc/mtrace.c: Cosmetic cleanup.
|
|
|
147e83 |
|
|
|
147e83 |
Remove an unused #define and use ANSI prototypes.
|
|
|
147e83 |
|
|
|
147e83 |
Generated code identical on x86_64-unknown-linux-gnu.
|
|
|
147e83 |
|
|
|
147e83 |
ChangeLog:
|
|
|
147e83 |
|
|
|
147e83 |
2014-02-11 Will Newton <will.newton@linaro.org>
|
|
|
147e83 |
|
|
|
147e83 |
* malloc/mtrace.c (attribute_hidden): Remove unused macro
|
|
|
147e83 |
definition. (tr_where, tr_freehook, tr_mallochook,
|
|
|
147e83 |
tr_reallochook, tr_memalignhook): Use ANSI protoype.
|
|
|
147e83 |
|
|
|
147e83 |
Conflicts:
|
|
|
147e83 |
malloc/mtrace.c
|
|
|
147e83 |
|
|
|
147e83 |
Textual conflicts due to missing backport of commit
|
|
|
147e83 |
6c8dbf00f536d78b1937b5af6f57be47fd376344 (Reformat malloc to gnu
|
|
|
147e83 |
style.).
|
|
|
147e83 |
|
|
|
147e83 |
diff --git a/malloc/mtrace.c b/malloc/mtrace.c
|
|
|
147e83 |
index 34ec2a85b219882c..5c4deda5a55a799c 100644
|
|
|
147e83 |
--- a/malloc/mtrace.c
|
|
|
147e83 |
+++ b/malloc/mtrace.c
|
|
|
147e83 |
@@ -41,10 +41,6 @@
|
|
|
147e83 |
|
|
|
147e83 |
#include <kernel-features.h>
|
|
|
147e83 |
|
|
|
147e83 |
-#ifndef attribute_hidden
|
|
|
147e83 |
-# define attribute_hidden
|
|
|
147e83 |
-#endif
|
|
|
147e83 |
-
|
|
|
147e83 |
#define TRACE_BUFFER_SIZE 512
|
|
|
147e83 |
|
|
|
147e83 |
static FILE *mallstream;
|
|
|
147e83 |
@@ -77,12 +73,8 @@ tr_break (void)
|
|
|
147e83 |
}
|
|
|
147e83 |
libc_hidden_def (tr_break)
|
|
|
147e83 |
|
|
|
147e83 |
-static void tr_where (const __ptr_t, Dl_info *) __THROW internal_function;
|
|
|
147e83 |
-static void
|
|
|
147e83 |
-internal_function
|
|
|
147e83 |
-tr_where (caller, info)
|
|
|
147e83 |
- const __ptr_t caller;
|
|
|
147e83 |
- Dl_info *info;
|
|
|
147e83 |
+static void internal_function
|
|
|
147e83 |
+tr_where (const __ptr_t caller, Dl_info *info)
|
|
|
147e83 |
{
|
|
|
147e83 |
if (caller != NULL)
|
|
|
147e83 |
{
|
|
|
147e83 |
@@ -115,7 +107,6 @@ tr_where (caller, info)
|
|
|
147e83 |
}
|
|
|
147e83 |
}
|
|
|
147e83 |
|
|
|
147e83 |
-
|
|
|
147e83 |
static Dl_info *
|
|
|
147e83 |
lock_and_info (const __ptr_t caller, Dl_info *mem)
|
|
|
147e83 |
{
|
|
|
147e83 |
@@ -129,12 +120,8 @@ lock_and_info (const __ptr_t caller, Dl_info *mem)
|
|
|
147e83 |
return res;
|
|
|
147e83 |
}
|
|
|
147e83 |
|
|
|
147e83 |
-
|
|
|
147e83 |
-static void tr_freehook (__ptr_t, const __ptr_t) __THROW;
|
|
|
147e83 |
static void
|
|
|
147e83 |
-tr_freehook (ptr, caller)
|
|
|
147e83 |
- __ptr_t ptr;
|
|
|
147e83 |
- const __ptr_t caller;
|
|
|
147e83 |
+tr_freehook (__ptr_t ptr, const __ptr_t caller)
|
|
|
147e83 |
{
|
|
|
147e83 |
if (ptr == NULL)
|
|
|
147e83 |
return;
|
|
|
147e83 |
@@ -159,11 +146,8 @@ tr_freehook (ptr, caller)
|
|
|
147e83 |
__libc_lock_unlock (lock);
|
|
|
147e83 |
}
|
|
|
147e83 |
|
|
|
147e83 |
-static __ptr_t tr_mallochook (size_t, const __ptr_t) __THROW;
|
|
|
147e83 |
static __ptr_t
|
|
|
147e83 |
-tr_mallochook (size, caller)
|
|
|
147e83 |
- size_t size;
|
|
|
147e83 |
- const __ptr_t caller;
|
|
|
147e83 |
+tr_mallochook (size_t size, const __ptr_t caller)
|
|
|
147e83 |
{
|
|
|
147e83 |
__ptr_t hdr;
|
|
|
147e83 |
|
|
|
147e83 |
@@ -189,13 +173,8 @@ tr_mallochook (size, caller)
|
|
|
147e83 |
return hdr;
|
|
|
147e83 |
}
|
|
|
147e83 |
|
|
|
147e83 |
-static __ptr_t tr_reallochook (__ptr_t, size_t, const __ptr_t)
|
|
|
147e83 |
- __THROW;
|
|
|
147e83 |
static __ptr_t
|
|
|
147e83 |
-tr_reallochook (ptr, size, caller)
|
|
|
147e83 |
- __ptr_t ptr;
|
|
|
147e83 |
- size_t size;
|
|
|
147e83 |
- const __ptr_t caller;
|
|
|
147e83 |
+tr_reallochook (__ptr_t ptr, size_t size, const __ptr_t caller)
|
|
|
147e83 |
{
|
|
|
147e83 |
__ptr_t hdr;
|
|
|
147e83 |
|
|
|
147e83 |
@@ -237,12 +216,8 @@ tr_reallochook (ptr, size, caller)
|
|
|
147e83 |
return hdr;
|
|
|
147e83 |
}
|
|
|
147e83 |
|
|
|
147e83 |
-static __ptr_t tr_memalignhook (size_t, size_t,
|
|
|
147e83 |
- const __ptr_t) __THROW;
|
|
|
147e83 |
static __ptr_t
|
|
|
147e83 |
-tr_memalignhook (alignment, size, caller)
|
|
|
147e83 |
- size_t alignment, size;
|
|
|
147e83 |
- const __ptr_t caller;
|
|
|
147e83 |
+tr_memalignhook (size_t alignment, size_t size, const __ptr_t caller)
|
|
|
147e83 |
{
|
|
|
147e83 |
__ptr_t hdr;
|
|
|
147e83 |
|
|
|
147e83 |
@@ -271,7 +246,6 @@ tr_memalignhook (alignment, size, caller)
|
|
|
147e83 |
}
|
|
|
147e83 |
|
|
|
147e83 |
|
|
|
147e83 |
-
|
|
|
147e83 |
#ifdef _LIBC
|
|
|
147e83 |
|
|
|
147e83 |
/* This function gets called to make sure all memory the library
|