
#include <stdio.h>

#ifndef DARWIN
#include <malloc.h>
#endif

#include "memutil.h"

void
memutil_printMemAllocated()
{
#ifdef LINUX
    struct mallinfo info;

    info = mallinfo();

    printf ("= allocated: %d\n", info.uordblks);
#else
    printf("memutil_printMemAllocated() not supported on Darwin.");
#endif

}

int
memutil_getMemAllocated()
{
#ifdef LINUX
    struct mallinfo info;

    info = mallinfo();

    return (info.uordblks);
#else
   return 0;
#endif
}
