mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
Consistently use the same #if style. Also, fix a bug testing for sbrk(3)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19071 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -50,11 +50,11 @@ static char* som = reinterpret_cast<char*>(::sbrk(0));
|
|||||||
uint64_t
|
uint64_t
|
||||||
Process::GetMallocUsage()
|
Process::GetMallocUsage()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_MALLINFO
|
#if defined(HAVE_MALLINFO)
|
||||||
struct mallinfo mi;
|
struct mallinfo mi;
|
||||||
mi = ::mallinfo();
|
mi = ::mallinfo();
|
||||||
return mi.uordblks;
|
return mi.uordblks;
|
||||||
#elif HAVE_SBRK
|
#elif defined(HAVE_SBRK)
|
||||||
// Note this is only an approximation and more closely resembles
|
// Note this is only an approximation and more closely resembles
|
||||||
// the value returned by mallinfo in the arena field.
|
// the value returned by mallinfo in the arena field.
|
||||||
char * eom = sbrk(0);
|
char * eom = sbrk(0);
|
||||||
@@ -71,7 +71,7 @@ Process::GetMallocUsage()
|
|||||||
uint64_t
|
uint64_t
|
||||||
Process::GetTotalMemoryUsage()
|
Process::GetTotalMemoryUsage()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_MALLINFO
|
#if defined(HAVE_MALLINFO)
|
||||||
struct mallinfo mi = ::mallinfo();
|
struct mallinfo mi = ::mallinfo();
|
||||||
return mi.uordblks + mi.hblkhd;
|
return mi.uordblks + mi.hblkhd;
|
||||||
#else
|
#else
|
||||||
@@ -85,7 +85,7 @@ Process::GetTimeUsage(TimeValue& elapsed, TimeValue& user_time,
|
|||||||
TimeValue& sys_time)
|
TimeValue& sys_time)
|
||||||
{
|
{
|
||||||
elapsed = TimeValue::now();
|
elapsed = TimeValue::now();
|
||||||
#ifdef HAVE_GETRUSAGE
|
#if defined(HAVE_GETRUSAGE)
|
||||||
struct rusage usage;
|
struct rusage usage;
|
||||||
::getrusage(RUSAGE_SELF, &usage);
|
::getrusage(RUSAGE_SELF, &usage);
|
||||||
user_time.seconds( usage.ru_utime.tv_sec );
|
user_time.seconds( usage.ru_utime.tv_sec );
|
||||||
|
@@ -50,11 +50,11 @@ static char* som = reinterpret_cast<char*>(::sbrk(0));
|
|||||||
uint64_t
|
uint64_t
|
||||||
Process::GetMallocUsage()
|
Process::GetMallocUsage()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_MALLINFO
|
#if defined(HAVE_MALLINFO)
|
||||||
struct mallinfo mi;
|
struct mallinfo mi;
|
||||||
mi = ::mallinfo();
|
mi = ::mallinfo();
|
||||||
return mi.uordblks;
|
return mi.uordblks;
|
||||||
#elif HAVE_SBRK
|
#elif defined(HAVE_SBRK)
|
||||||
// Note this is only an approximation and more closely resembles
|
// Note this is only an approximation and more closely resembles
|
||||||
// the value returned by mallinfo in the arena field.
|
// the value returned by mallinfo in the arena field.
|
||||||
char * eom = sbrk(0);
|
char * eom = sbrk(0);
|
||||||
@@ -71,7 +71,7 @@ Process::GetMallocUsage()
|
|||||||
uint64_t
|
uint64_t
|
||||||
Process::GetTotalMemoryUsage()
|
Process::GetTotalMemoryUsage()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_MALLINFO
|
#if defined(HAVE_MALLINFO)
|
||||||
struct mallinfo mi = ::mallinfo();
|
struct mallinfo mi = ::mallinfo();
|
||||||
return mi.uordblks + mi.hblkhd;
|
return mi.uordblks + mi.hblkhd;
|
||||||
#else
|
#else
|
||||||
@@ -85,7 +85,7 @@ Process::GetTimeUsage(TimeValue& elapsed, TimeValue& user_time,
|
|||||||
TimeValue& sys_time)
|
TimeValue& sys_time)
|
||||||
{
|
{
|
||||||
elapsed = TimeValue::now();
|
elapsed = TimeValue::now();
|
||||||
#ifdef HAVE_GETRUSAGE
|
#if defined(HAVE_GETRUSAGE)
|
||||||
struct rusage usage;
|
struct rusage usage;
|
||||||
::getrusage(RUSAGE_SELF, &usage);
|
::getrusage(RUSAGE_SELF, &usage);
|
||||||
user_time.seconds( usage.ru_utime.tv_sec );
|
user_time.seconds( usage.ru_utime.tv_sec );
|
||||||
|
Reference in New Issue
Block a user