This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] malloc: Remove the internal_function attribute


2017-08-16  Florian Weimer  <fweimer@redhat.com>

	* malloc/arena.c (__malloc_fork_lock_parent)
	(__malloc_fork_unlock_parent, __malloc_fork_unlock_child)
	(next_env_entry, new_heap, heap_trim, arena_get2): Remove
	internal_function from defintions.
	* malloc/hooks.c (mem2mem_check, mem2chunk_check, top_check):
	Likewise.
	* malloc/malloc-internal.h (__malloc_fork_lock_parent)
	(__malloc_fork_unlock_parent, __malloc_fork_unlock_child): Remove
	internal_function from declarations.
	* malloc/malloc.c (internal_function): Do not define.
	(mem2mem_check, top_check): Remove internal_function from
	declarations.
	(munmap_chunk, mremap_chunk): Remove internal_function.
	* malloc/mtrace.c (tr_where): Likewise.

diff --git a/malloc/arena.c b/malloc/arena.c
index dc14fae152..5a4fbbe931 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -141,7 +141,6 @@ int __malloc_initialized = -1;
    subsystem.  */
 
 void
-internal_function
 __malloc_fork_lock_parent (void)
 {
   if (__malloc_initialized < 1)
@@ -162,7 +161,6 @@ __malloc_fork_lock_parent (void)
 }
 
 void
-internal_function
 __malloc_fork_unlock_parent (void)
 {
   if (__malloc_initialized < 1)
@@ -179,7 +177,6 @@ __malloc_fork_unlock_parent (void)
 }
 
 void
-internal_function
 __malloc_fork_unlock_child (void)
 {
   if (__malloc_initialized < 1)
@@ -247,7 +244,6 @@ TUNABLE_CALLBACK_FNDECL (set_tcache_unsorted_limit, size_t)
 extern char **_environ;
 
 static char *
-internal_function
 next_env_entry (char ***position)
 {
   char **current = *position;
@@ -463,7 +459,6 @@ static char *aligned_heap_area;
    of the page size. */
 
 static heap_info *
-internal_function
 new_heap (size_t size, size_t top_pad)
 {
   size_t pagesize = GLRO (dl_pagesize);
@@ -607,7 +602,6 @@ shrink_heap (heap_info *h, long diff)
     } while (0)
 
 static int
-internal_function
 heap_trim (heap_info *heap, size_t pad)
 {
   mstate ar_ptr = heap->ar_ptr;
@@ -897,7 +891,6 @@ out:
 }
 
 static mstate
-internal_function
 arena_get2 (size_t size, mstate avoid_arena)
 {
   mstate a;
diff --git a/malloc/hooks.c b/malloc/hooks.c
index 1d80be20d2..9543f449b4 100644
--- a/malloc/hooks.c
+++ b/malloc/hooks.c
@@ -137,7 +137,6 @@ malloc_check_get_size (mchunkptr p)
    into a user pointer with requested size req_sz. */
 
 static void *
-internal_function
 mem2mem_check (void *ptr, size_t req_sz)
 {
   mchunkptr p;
@@ -171,7 +170,6 @@ mem2mem_check (void *ptr, size_t req_sz)
    pointer.  If the provided pointer is not valid, return NULL. */
 
 static mchunkptr
-internal_function
 mem2chunk_check (void *mem, unsigned char **magic_p)
 {
   mchunkptr p;
@@ -236,7 +234,6 @@ mem2chunk_check (void *mem, unsigned char **magic_p)
    necessary. */
 
 static int
-internal_function
 top_check (void)
 {
   mchunkptr t = top (&main_arena);
diff --git a/malloc/malloc-internal.h b/malloc/malloc-internal.h
index 6a62717e69..a9c9c6af7f 100644
--- a/malloc/malloc-internal.h
+++ b/malloc/malloc-internal.h
@@ -63,13 +63,13 @@
 
 
 /* Called in the parent process before a fork.  */
-void __malloc_fork_lock_parent (void) internal_function attribute_hidden;
+void __malloc_fork_lock_parent (void) attribute_hidden;
 
 /* Called in the parent process after a fork.  */
-void __malloc_fork_unlock_parent (void) internal_function attribute_hidden;
+void __malloc_fork_unlock_parent (void) attribute_hidden;
 
 /* Called in the child process after a fork.  */
-void __malloc_fork_unlock_child (void) internal_function attribute_hidden;
+void __malloc_fork_unlock_child (void) attribute_hidden;
 
 /* Set *RESULT to LEFT * RIGHT.  Return true if the multiplication
    overflowed.  */
diff --git a/malloc/malloc.c b/malloc/malloc.c
index e3ff778113..9274c968fd 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -999,13 +999,6 @@ int      __posix_memalign(void **, size_t, size_t);
 #define RETURN_ADDRESS(X_) (NULL)
 #endif
 
-/* On some platforms we can compile internal, not exported functions better.
-   Let the environment provide a macro and define it to be empty if it
-   is not available.  */
-#ifndef internal_function
-# define internal_function
-#endif
-
 /* Forward declarations.  */
 struct malloc_chunk;
 typedef struct malloc_chunk* mchunkptr;
@@ -1021,11 +1014,11 @@ static void*  _mid_memalign(size_t, size_t, void *);
 
 static void malloc_printerr(int action, const char *str, void *ptr, mstate av);
 
-static void* internal_function mem2mem_check(void *p, size_t sz);
-static int internal_function top_check(void);
-static void internal_function munmap_chunk(mchunkptr p);
+static void* mem2mem_check(void *p, size_t sz);
+static int top_check(void);
+static void munmap_chunk(mchunkptr p);
 #if HAVE_MREMAP
-static mchunkptr internal_function mremap_chunk(mchunkptr p, size_t new_size);
+static mchunkptr mremap_chunk(mchunkptr p, size_t new_size);
 #endif
 
 static void*   malloc_check(size_t sz, const void *caller);
@@ -2853,7 +2846,6 @@ systrim (size_t pad, mstate av)
 }
 
 static void
-internal_function
 munmap_chunk (mchunkptr p)
 {
   INTERNAL_SIZE_T size = chunksize (p);
@@ -2891,7 +2883,6 @@ munmap_chunk (mchunkptr p)
 #if HAVE_MREMAP
 
 static mchunkptr
-internal_function
 mremap_chunk (mchunkptr p, size_t new_size)
 {
   size_t pagesize = GLRO (dl_pagesize);
diff --git a/malloc/mtrace.c b/malloc/mtrace.c
index d6eb49757b..6c362d9679 100644
--- a/malloc/mtrace.c
+++ b/malloc/mtrace.c
@@ -73,7 +73,7 @@ tr_break (void)
 }
 libc_hidden_def (tr_break)
 
-static void internal_function
+static void
 tr_where (const void *caller, Dl_info *info)
 {
   if (caller != NULL)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]