]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Move a function and its prototype VG_(malloc_effective_client_redzone_size)
authorFlorian Krohm <florian@eich-krohm.de>
Sun, 15 Sep 2013 09:18:03 +0000 (09:18 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sun, 15 Sep 2013 09:18:03 +0000 (09:18 +0000)
to a conceptually better place.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13546

coregrind/m_mallocfree.c
coregrind/m_replacemalloc/replacemalloc_core.c
coregrind/pub_core_mallocfree.h
include/pub_tool_mallocfree.h
include/pub_tool_replacemalloc.h

index d9e10e25ff543ae76f1eccc75f3e572dcca17e59..013f89fafe3b0b9f33c70fa749b60b10012b1f8d 100644 (file)
@@ -511,16 +511,6 @@ static ArenaId arenaP_to_ArenaId ( Arena *a )
    return arena;
 }
 
-SizeT VG_(malloc_effective_client_redzone_size)(void)
-{
-   vg_assert(VG_(needs).malloc_replacement);
-   ensure_mm_init (VG_AR_CLIENT);
-   /*  ensure_mm_init will call arena_init if not yet done.
-       This then ensures that the arena redzone size is properly
-       initialised. */
-   return arenaId_to_ArenaP(VG_AR_CLIENT)->rz_szB;
-}
-
 // Initialise an arena.  rz_szB is the (default) minimum redzone size;
 // It might be overriden by VG_(clo_redzone_size) or VG_(clo_core_redzone_size).
 // it might be made bigger to ensure that VG_MIN_MALLOC_SZB is observed.
@@ -2186,6 +2176,14 @@ void VG_(mallinfo) ( ThreadId tid, struct vg_mallinfo* mi )
    mi->keepcost = 0; // may want some value in here
 }
 
+SizeT VG_(arena_redzone_size) ( ArenaId aid )
+{
+   ensure_mm_init (VG_AR_CLIENT);
+   /*  ensure_mm_init will call arena_init if not yet done.
+       This then ensures that the arena redzone size is properly
+       initialised. */
+   return arenaId_to_ArenaP(aid)->rz_szB;
+}
 
 /*------------------------------------------------------------*/
 /*--- Services layered on top of malloc/free.              ---*/
index 773caef6d0810bd0c4b136dfac2c734a13e4d114..083164b7ec2690de6374047b2446864d82431684 100644 (file)
@@ -31,6 +31,8 @@
 #include "pub_core_basics.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_libcprint.h"
+#include "pub_core_libcassert.h"
+#include "pub_core_tooliface.h"       // VG_(needs)
 #include "pub_core_mallocfree.h"
 #include "pub_core_options.h"
 #include "pub_core_replacemalloc.h"
@@ -71,6 +73,13 @@ Bool VG_(replacement_malloc_process_cmd_line_option)(const HChar* arg)
    return True;
 }
 
+SizeT VG_(malloc_effective_client_redzone_size)(void)
+{
+   vg_assert(VG_(needs).malloc_replacement);
+
+   return VG_(arena_redzone_size)(VG_AR_CLIENT);
+}
+
 /*------------------------------------------------------------*/
 /*--- Useful functions                                     ---*/
 /*------------------------------------------------------------*/
index 834df471ffc3e2a8ddb8e4e21c645bafb3af945e..bb163a77db12794d76a5534d9483ff44790ed617 100644 (file)
@@ -117,6 +117,8 @@ extern HChar* VG_(arena_strdup)  ( ArenaId aid, const HChar* cc,
 
 extern SizeT VG_(arena_malloc_usable_size) ( ArenaId aid, void* payload );
 
+extern SizeT VG_(arena_redzone_size) ( ArenaId aid );
+
 extern void  VG_(mallinfo) ( ThreadId tid, struct vg_mallinfo* mi );
 
 // VG_(arena_perm_malloc) is for permanent allocation of small blocks.
index 394eb8b37ba40dca49a9e49937bb7239217040e6..c6c37d1e408772146f0c3fdf0e53cd98c59bad54 100644 (file)
@@ -47,15 +47,6 @@ extern HChar* VG_(strdup)        ( const HChar* cc, const HChar* s );
 // possibly some more due to rounding up.
 extern SizeT VG_(malloc_usable_size)( void* p );
 
-
-// If tool is replacing malloc for the client, the below returns
-// the effective client redzone as derived from the default
-// provided by the tool, VG_(clo_redzone_size) and the minimum
-// redzone required by m_mallocfree.c.
-// It is an error to call this before VG_(needs_malloc_replacement) has
-// been called.
-extern SizeT VG_(malloc_effective_client_redzone_size)(void);
-
 // TODO: move somewhere else
 // Call here to bomb the system when out of memory (mmap anon fails)
 __attribute__((noreturn))
index 97a966718670f11ecfd6c1844ac1534c66afabfc..a44e156236de7f92205214d0ba13e2fd2398e206 100644 (file)
@@ -65,6 +65,14 @@ extern UInt VG_(clo_alignment);
 
 extern Bool VG_(replacement_malloc_process_cmd_line_option) ( const HChar* arg );
 
+// If tool is replacing malloc for the client, the below returns
+// the effective client redzone as derived from the default
+// provided by the tool, VG_(clo_redzone_size) and the minimum
+// redzone required by m_mallocfree.c.
+// It is an error to call this before VG_(needs_malloc_replacement) has
+// been called.
+extern SizeT VG_(malloc_effective_client_redzone_size)(void);
+
 #endif   // __PUB_TOOL_REPLACEMALLOC_H
 
 /*--------------------------------------------------------------------*/