]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Get rid of VG_(malloc_aligned)(), and make VG_(arena_malloc_aligned)() local
authorNicholas Nethercote <njn@valgrind.org>
Sun, 13 Mar 2005 18:33:02 +0000 (18:33 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 13 Mar 2005 18:33:02 +0000 (18:33 +0000)
to vg_malloc2.c -- the core and tools never do allocations with alignments
different to the default alignment.

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

coregrind/core.h
coregrind/vg_malloc2.c
include/tool.h.base

index 195156507940c6ad837152cd081bb1deaea638fa..5ccf02913482a279cb3c5c91801242eae9c17709 100644 (file)
@@ -386,8 +386,6 @@ extern void  VG_(arena_free)    ( ArenaId arena, void* ptr );
 extern void* VG_(arena_calloc)  ( ArenaId arena, 
                                   SizeT nmemb, SizeT bytes_per_memb );
 extern void* VG_(arena_realloc) ( ArenaId arena, void* ptr, SizeT size );
-extern void* VG_(arena_malloc_aligned) ( ArenaId aid, SizeT req_alignB, 
-                                         SizeT req_pszB );
 
 extern SizeT VG_(arena_payload_szB) ( ArenaId aid, void* payload );
 
index 75f5472e66644d37bc2766073357f09b44bce528..31b4db385d8337ae35c11265a1e1b632a5f59e71 100644 (file)
@@ -1140,7 +1140,8 @@ void VG_(arena_free) ( ArenaId aid, void* ptr )
    .    .               .   .   .               .   .
 
 */
-void* VG_(arena_malloc_aligned) ( ArenaId aid, SizeT req_alignB, SizeT req_pszB )
+static 
+void* arena_malloc_aligned ( ArenaId aid, SizeT req_alignB, SizeT req_pszB )
 {
    SizeT  base_pszB_req, base_pszB_act, frag_bszB;
    Block  *base_b, *align_b;
@@ -1160,9 +1161,9 @@ void* VG_(arena_malloc_aligned) ( ArenaId aid, SizeT req_alignB, SizeT req_pszB
    if (req_alignB < VG_MIN_MALLOC_SZB
        || req_alignB > 1048576
        || VG_(log2)( VG_(clo_alignment) ) == -1 /* not a power of 2 */) {
-      VG_(printf)("VG_(arena_malloc_aligned)(%p, %d, %d)\nbad alignment", 
+      VG_(printf)("arena_malloc_aligned(%p, %d, %d)\nbad alignment", 
                   a, req_alignB, req_pszB );
-      VG_(core_panic)("VG_(arena_malloc_aligned)");
+      VG_(core_panic)("arena_malloc_aligned");
       /*NOTREACHED*/
    }
    // Paranoid
@@ -1335,20 +1336,14 @@ void* VG_(realloc) ( void* ptr, SizeT size )
    return VG_(arena_realloc) ( VG_AR_TOOL, ptr, size );
 }
 
-void* VG_(malloc_aligned) ( SizeT req_alignB, SizeT req_pszB )
-{
-   return VG_(arena_malloc_aligned) ( VG_AR_TOOL, req_alignB, req_pszB );
-}
-
-
 void* VG_(cli_malloc) ( SizeT align, SizeT nbytes )                 
 {                                                                             
-   // 'align' should be valid by now.  VG_(arena_malloc_aligned)() will
+   // 'align' should be valid by now.  arena_malloc_aligned() will
    // abort if it's not.
    if (VG_MIN_MALLOC_SZB == align)
-      return VG_(arena_malloc)         ( VG_AR_CLIENT, nbytes ); 
+      return VG_(arena_malloc)    ( VG_AR_CLIENT, nbytes ); 
    else                                                                       
-      return VG_(arena_malloc_aligned) ( VG_AR_CLIENT, align, nbytes );
+      return arena_malloc_aligned ( VG_AR_CLIENT, align, nbytes );
 }                                                                             
 
 void VG_(cli_free) ( void* p )                                   
index fa11571d6c83efce6e64a29d1f90f74e401149dc..871b2ca25bcc3ddc41f68c45abac96abe04b538d 100644 (file)
@@ -337,7 +337,6 @@ extern void* VG_(malloc)         ( SizeT nbytes );
 extern void  VG_(free)           ( void* p );
 extern void* VG_(calloc)         ( SizeT n, SizeT bytes_per_elem );
 extern void* VG_(realloc)        ( void* p, SizeT size );
-extern void* VG_(malloc_aligned) ( SizeT align_bytes, SizeT nbytes );
 
 /* terminate everything */
 extern void  VG_(exit)( Int status )