|
From: <sv...@va...> - 2008-03-24 11:56:55
|
Author: bart
Date: 2008-03-24 11:56:57 +0000 (Mon, 24 Mar 2008)
New Revision: 7778
Log:
Added support for jemalloc.
Modified:
branches/DRDDEV/coregrind/m_replacemalloc/vg_replace_malloc.c
Modified: branches/DRDDEV/coregrind/m_replacemalloc/vg_replace_malloc.c
===================================================================
--- branches/DRDDEV/coregrind/m_replacemalloc/vg_replace_malloc.c 2008-03-24 11:54:47 UTC (rev 7777)
+++ branches/DRDDEV/coregrind/m_replacemalloc/vg_replace_malloc.c 2008-03-24 11:56:57 UTC (rev 7778)
@@ -68,6 +68,10 @@
# error "Unknown platform"
#endif
+/* --- Soname of libjemalloc. --- */
+
+#define m_jemalloc_soname libjemallocZdsoZa /* libjemalloc.so* */
+
/* --- Soname of the GNU C++ library. --- */
#define m_libstdcxx_soname libstdcZpZpZa // libstdc++*
@@ -203,6 +207,7 @@
// (from_so, from_fn, v's replacement)
// malloc
+ALLOC_or_NULL(m_jemalloc_soname, malloc, malloc);
ALLOC_or_NULL(m_libstdcxx_soname, malloc, malloc);
ALLOC_or_NULL(m_libc_soname, malloc, malloc);
#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
@@ -319,6 +324,7 @@
}
// free
+FREE(m_jemalloc_soname, free, free );
FREE(m_libstdcxx_soname, free, free );
FREE(m_libc_soname, free, free );
#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
@@ -394,6 +400,7 @@
return v; \
}
+CALLOC(m_jemalloc_soname, calloc);
CALLOC(m_libc_soname, calloc);
#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
CALLOC(m_libc_soname, calloc_common);
@@ -426,6 +433,7 @@
return v; \
}
+REALLOC(m_jemalloc_soname, realloc);
REALLOC(m_libc_soname, realloc);
#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
REALLOC(m_libc_soname, realloc_common);
@@ -457,6 +465,7 @@
return v; \
}
+MEMALIGN(m_jemalloc_soname, memalign);
MEMALIGN(m_libc_soname, memalign);
@@ -483,6 +492,7 @@
((SizeT)pszB, size); \
}
+VALLOC(m_jemalloc_soname, valloc);
VALLOC(m_libc_soname, valloc);
@@ -566,6 +576,7 @@
return VKI_ENOMEM; \
}
+POSIX_MEMALIGN(m_jemalloc_soname, posix_memalign);
POSIX_MEMALIGN(m_libc_soname, posix_memalign);
#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
/* 27 Nov 07: it appears that xlc links into executables, a
@@ -596,6 +607,7 @@
return pszB; \
}
+MALLOC_USABLE_SIZE(m_jemalloc_soname, malloc_usable_size);
MALLOC_USABLE_SIZE(m_libc_soname, malloc_usable_size);
|