Branch: Tag:

2012-03-14

2012-03-14 12:50:18 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Moved struct mallinfo definition from malloc.c to global.h.

647: Inside #if defined(USE_DL_MALLOC) && !defined(HAVE_MALLINFO)
  /* dlmalloc has mallinfo. */   #if defined(USE_DL_MALLOC) && !defined(HAVE_MALLINFO)   #define HAVE_MALLINFO +  + #if defined (HAVE_MALLOC_H) && defined (HAVE_STRUCT_MALLINFO) + #include <malloc.h> + #else /* HAVE_MALLOC_H && HAVE_STRUCT_MALLINFO */ +  + #ifndef MALLINFO_FIELD_TYPE + #define MALLINFO_FIELD_TYPE size_t + #endif /* MALLINFO_FIELD_TYPE */ +  + /* dlmalloc definition of struct mallinfo. */ + struct mallinfo { +  MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ +  MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ +  MALLINFO_FIELD_TYPE smblks; /* always 0 */ +  MALLINFO_FIELD_TYPE hblks; /* always 0 */ +  MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ +  MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ +  MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ +  MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ +  MALLINFO_FIELD_TYPE fordblks; /* total free space */ +  MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ + }; +  + #endif /* HAVE_USR_INCLUDE_MALLOC_H */ +    #endif      #endif /* MACHINE_H */