pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:7120:    *! @note    *! Exactly what fields this function returns is version dependant.    *!    *! @seealso    *! @[_verify_internals()]    */   PMOD_EXPORT void f__memory_usage(INT32 args)   {    size_t num,size;    struct svalue *ss; - #ifdef HAVE_MALLINFO + #ifdef USE_DL_MALLOC +  struct mallinfo mi = dlmallinfo(); + #elif HAVE_MALLINFO    struct mallinfo mi = mallinfo();   #endif    pop_n_elems(args);    ss=Pike_sp;    - #ifdef HAVE_MALLINFO + #if defined(HAVE_MALLINFO) || defined(USE_DL_MALLOC)       push_text("num_malloc_blocks");    push_ulongest(1 + mi.hblks); /* 1 for the arena. */    push_text("malloc_block_bytes");    /* NB: Kludge for glibc: hblkhd is intended for malloc overhead    * according to the Solaris manpages, but glibc keeps the    * amount of mmapped memory there, and uses the arena only    * for the amount from sbrk.    *    * The hblkhd value on proper implementations should be