google / szl

A compiler and runtime for the Sawzall language
Other
69 stars 16 forks source link

HAVE_MALLINGO ifdef declaration in src/engine/memory.cc #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, 

You have a typo that isn't including malloc.h header in src/engine/memory.cc. 
It should be HAVE_MALLINFO and not HAVE_MALLINGO.

src/engine/memory.cc:
[...]
#ifdef HAVE_MALLINGO
#include <malloc.h>   // for mallinfo()
#endif
[...]
#ifdef HAVE_MALLINFO
    struct mallinfo info = mallinfo();
    // Ack, limited to 4GB.  Stored as "int", make sure we use full 32 bits.
    int64 freespace = static_cast<unsigned int>(info.fordblks);
    // As we get closer to running out of process memory, get more aggressive
    // about requiring that malloc space is available to minimize the chance
    // that we will run out of process memory.
    // (If we seem to have enough, do nothing and hope malloc succeeds.)
#else
    int freespace = 0;
#endif
[...]

Original issue reported on code.google.com by stra...@google.com on 5 Nov 2010 at 8:58

GoogleCodeExporter commented 9 years ago
Should be fixed as of r34.

Original comment by dbh@google.com on 9 Nov 2010 at 6:01

GoogleCodeExporter commented 9 years ago

Original comment by dbh@google.com on 11 Nov 2010 at 2:53