]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
VG_(client_calloc) was ignoring the --alignment= flag. Fix.
authorJulian Seward <jseward@acm.org>
Sat, 12 Oct 2002 17:55:17 +0000 (17:55 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 12 Oct 2002 17:55:17 +0000 (17:55 +0000)
This problem doesn't appear to exist in the head.

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_1_0_BRANCH@1210

vg_clientmalloc.c

index 167f056ab63e970f1aeec888a15a05330d1461ca..fe39e232e122fe584ec1f1def8bdde833cf8ea03 100644 (file)
@@ -385,7 +385,10 @@ void* VG_(client_calloc) ( ThreadState* tst, UInt nmemb, UInt size1 )
    }
 
    size      = nmemb * size1;
-   p         = (Addr)VG_(malloc)(VG_AR_CLIENT, size);
+   if (VG_(clo_alignment) == 4)
+      p = (Addr)VG_(malloc)(VG_AR_CLIENT, size);
+   else
+      p = (Addr)VG_(malloc_aligned)(VG_AR_CLIENT, VG_(clo_alignment), size);
    sc        = VG_(malloc)(VG_AR_PRIVATE, sizeof(ShadowChunk));
    sc->where = VG_(get_ExeContext)(False, tst->m_eip, tst->m_ebp);
    sc->size  = size;