Rename struct mallinfo -> struct dlmallinfo
Also: don't #include /usr/include/malloc.h in dlmalloc.h Change-Id: Ic73ff8862cc8aba371488b912255e28dd96374ff Signed-off-by: Dave Barach <dave@barachs.net>
This commit is contained in:
committed by
Damjan Marion
parent
d897adcebb
commit
af7dd5b32e
@@ -771,7 +771,7 @@ show_memory_usage (vlib_main_t * vm,
|
||||
/* *INDENT-OFF* */
|
||||
foreach_vlib_main (
|
||||
({
|
||||
struct mallinfo mi;
|
||||
struct dlmallinfo mi;
|
||||
void *mspace;
|
||||
mspace = clib_per_cpu_mheaps[index];
|
||||
|
||||
|
||||
@@ -2078,8 +2078,8 @@ static void do_check_malloc_state(mstate m) {
|
||||
/* ----------------------------- statistics ------------------------------ */
|
||||
|
||||
#if !NO_MALLINFO
|
||||
static struct mallinfo internal_mallinfo(mstate m) {
|
||||
struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
static struct dlmallinfo internal_mallinfo(mstate m) {
|
||||
struct dlmallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
ensure_initialization();
|
||||
if (!PREACTION(m)) {
|
||||
check_malloc_state(m);
|
||||
@@ -3963,7 +3963,7 @@ size_t dlmalloc_set_footprint_limit(size_t bytes) {
|
||||
}
|
||||
|
||||
#if !NO_MALLINFO
|
||||
struct mallinfo dlmallinfo(void) {
|
||||
struct dlmallinfo dlmallinfo(void) {
|
||||
return internal_mallinfo(gm);
|
||||
}
|
||||
#endif /* NO_MALLINFO */
|
||||
@@ -4781,7 +4781,7 @@ size_t mspace_set_footprint_limit(mspace msp, size_t bytes) {
|
||||
}
|
||||
|
||||
#if !NO_MALLINFO
|
||||
struct mallinfo mspace_mallinfo(mspace msp) {
|
||||
struct dlmallinfo mspace_mallinfo(mspace msp) {
|
||||
mstate ms = (mstate)msp;
|
||||
if (!ok_magic(ms)) {
|
||||
USAGE_ERROR_ACTION(ms,ms);
|
||||
|
||||
@@ -768,14 +768,14 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
|
||||
|
||||
/* #define HAVE_USR_INCLUDE_MALLOC_H */
|
||||
|
||||
#ifdef HAVE_USR_INCLUDE_MALLOC_H
|
||||
#if 0 // def HAVE_USR_INCLUDE_MALLOC_H
|
||||
#include "/usr/include/malloc.h"
|
||||
#else /* HAVE_USR_INCLUDE_MALLOC_H */
|
||||
#ifndef STRUCT_MALLINFO_DECLARED
|
||||
/* HP-UX (and others?) redefines mallinfo unless _STRUCT_MALLINFO is defined */
|
||||
#define _STRUCT_MALLINFO
|
||||
#define STRUCT_MALLINFO_DECLARED 1
|
||||
struct mallinfo {
|
||||
struct dlmallinfo {
|
||||
MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */
|
||||
MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */
|
||||
MALLINFO_FIELD_TYPE smblks; /* always 0 */
|
||||
@@ -837,7 +837,7 @@ extern "C" {
|
||||
#define dlrealloc_in_place realloc_in_place
|
||||
#define dlvalloc valloc
|
||||
#define dlpvalloc pvalloc
|
||||
#define dlmallinfo mallinfo
|
||||
// #define dlmallinfo mallinfo
|
||||
#define dlmallopt mallopt
|
||||
#define dlmalloc_trim malloc_trim
|
||||
#define dlmalloc_stats malloc_stats
|
||||
@@ -1084,7 +1084,7 @@ DLMALLOC_EXPORT void dlmalloc_inspect_all(void(*handler)(void*, void *, size_t,
|
||||
be kept as longs, the reported values may wrap around zero and
|
||||
thus be inaccurate.
|
||||
*/
|
||||
DLMALLOC_EXPORT struct mallinfo dlmallinfo(void);
|
||||
DLMALLOC_EXPORT struct dlmallinfo dlmallinfo(void);
|
||||
#endif /* NO_MALLINFO */
|
||||
|
||||
/*
|
||||
@@ -1401,7 +1401,7 @@ DLMALLOC_EXPORT size_t mspace_max_footprint(mspace msp);
|
||||
mspace_mallinfo behaves as mallinfo, but reports properties of
|
||||
the given space.
|
||||
*/
|
||||
DLMALLOC_EXPORT struct mallinfo mspace_mallinfo(mspace msp);
|
||||
DLMALLOC_EXPORT struct dlmallinfo mspace_mallinfo(mspace msp);
|
||||
#endif /* NO_MALLINFO */
|
||||
|
||||
/*
|
||||
|
||||
@@ -382,7 +382,7 @@ format_mheap (u8 * s, va_list * va)
|
||||
{
|
||||
void *heap = va_arg (*va, u8 *);
|
||||
int verbose = va_arg (*va, int);
|
||||
struct mallinfo mi;
|
||||
struct dlmallinfo mi;
|
||||
mheap_trace_main_t *tm = &mheap_trace_main;
|
||||
|
||||
mi = mspace_mallinfo (heap);
|
||||
|
||||
Reference in New Issue
Block a user