more cleanups.

This commit is contained in:
Vítor Santos Costa
2011-03-02 23:19:39 +00:00
parent 6f1537475f
commit da1df3d851
17 changed files with 159 additions and 98 deletions

View File

@@ -445,10 +445,11 @@ UsedMemory(void)
uintptr_t
FreeMemory(void)
{ uintptr_t used = UsedMemory();
{
#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_DATA)
struct rlimit limit;
uintptr_t used = UsedMemory();
struct rlimit limit;
if ( getrlimit(RLIMIT_DATA, &limit) == 0 )
return limit.rlim_cur - used;