11#include "omDefaultConfig.h"
16omInfo_t
om_Info = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
29#ifdef OM_MALLOC_UPDATE_INFO
30 OM_MALLOC_UPDATE_INFO;
35 if (
om_Info.CurrentBytesFromMalloc < 0)
36 om_Info.CurrentBytesFromMalloc = 0;
41#ifdef OM_MALLOC_USED_BYTES
42 om_Info.UsedBytesMalloc = OM_MALLOC_USED_BYTES;
45 -
om_Info.InternalUsedBytesMalloc;
47#ifdef OM_MALLOC_AVAIL_BYTES
48 om_Info.AvailBytesMalloc = OM_MALLOC_AVAIL_BYTES;
54#ifdef OM_HAVE_VALLOC_MMAP
58#ifdef OM_MALLOC_CURRENT_BYTES_MMAP
59 om_Info.CurrentBytesMmap += OM_MALLOC_CURRENT_BYTES_MMAP;
61#ifdef OM_MALLOC_MAX_BYTES_MMAP
62 om_Info.MaxBytesMmap += OM_MALLOC_MAX_BYTES_MMAP;
65#ifndef OM_MALLOC_CURRENT_BYTES_SBRK
79 om_Info.CurrentBytesSbrk = OM_MALLOC_CURRENT_BYTES_SBRK;
80#ifdef OM_MALLOC_MAX_BYTES_SBRK
81 om_Info.MaxBytesSbrk = OM_MALLOC_MAX_BYTES_SBRK;
88#ifdef OM_MALLOC_CURRENT_BYTES_SYSTEM
89 om_Info.CurrentBytesSystem = OM_MALLOC_CURRENT_BYTES_SYSTEM;
95#ifdef OM_HAVE_VALLOC_MMAP
99#if ! (defined(OM_HAVE_VALLOC_MMAP) && defined(OM_MALLOC_MAX_BYTES_SYSTEM))
100#ifdef OM_MALLOC_MAX_BYTES_SYSTEM
101 om_Info.MaxBytesSystem = OM_MALLOC_MAX_BYTES_SYSTEM;
121 fprintf(
fd,
"System %ldk:%ldk Appl %ldk/%ldk Malloc %ldk/%ldk Valloc %ldk/%ldk Pages %ld/%ld Regions %ld:%ld Internal: %ld\n",
125 om_Info.CurrentBytesFromValloc/1024,
om_Info.AvailBytesFromValloc/1024,
128 om_Info.InternalUsedBytesMalloc);
135 fputs(
" Current: Max:\n",
fd);
136 fprintf(
fd,
"BytesSystem: %8ldk %8ldk\n",
om_Info.CurrentBytesSystem/1024,
om_Info.MaxBytesSystem/1024);
137 fprintf(
fd,
"BytesSbrk: %8ldk %8ldk\n",
om_Info.CurrentBytesSbrk/1024,
om_Info.MaxBytesSbrk/1024);
138 fprintf(
fd,
"BytesMmap: %8ldk %8ldk\n",
om_Info.CurrentBytesMmap/1024,
om_Info.MaxBytesMmap/1024);
139 fprintf(
fd,
"BytesFromMalloc: %8ldk %8ldk\n",
om_Info.CurrentBytesFromMalloc/1024,
om_Info.MaxBytesFromMalloc/1024);
140 fprintf(
fd,
"BytesFromValloc: %8ldk %8ldk\n",
om_Info.CurrentBytesFromValloc/1024,
om_Info.MaxBytesFromValloc/1024);
141 fprintf(
fd,
"PagesAlloc: %8ld %8ld \n",
om_Info.UsedPages,
om_Info.MaxPages);
142 fprintf(
fd,
"RegionsAlloc: %8ld %8ld \n",
om_Info.CurrentRegionsAlloc,
om_Info.MaxRegionsAlloc);
143 fputs(
" Used: Avail:\n",
fd);
144 fprintf(
fd,
"BytesAppl: %8ldk %8ldk\n",
om_Info.UsedBytes/1024,
om_Info.AvailBytes/1024);
145 fprintf(
fd,
"BytesMalloc: %8ldk %8ldk\n",
om_Info.UsedBytesMalloc/1024,
om_Info.AvailBytesMalloc/1024);
146 fprintf(
fd,
"BytesValloc: %8ldk %8ldk\n",
om_Info.UsedBytesFromValloc/1024,
om_Info.AvailBytesFromValloc/1024);
unsigned long om_SbrkInit