/* $Id$ */
/** @file
* Allocate all memory we can get and then quit.
*/
/*
* Copyright (C) 2011-2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
typedef struct TSTALLOC
{
/** The page sequence number. */
/** The allocation sequence number. */
/** The allocation size. */
/** Pointer to the ourselves (paranoid). */
void *pv;
/** Linked list node. */
} TSTALLOC;
{
{
{
iPageSeq++;
}
iAllocSeq++;
}
return true;
}
{
#if ARCH_BITS == 64
#else
#endif
for (;;)
{
/*
* Allocate a chunk and make sure all the pages are there.
*/
if (pCur)
{
{
}
/*
* Update the statistics.
*/
cNsElapsed += cNsThis;
cAllocs++;
/*
* Link the allocation.
*/
/*
* Print progress info?
*/
#if ARCH_BITS == 64
#else
#endif
)
{
}
}
else
{
/*
* Try again with a smaller request.
*/
RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "Failed to allocate %'zu bytes (after %'zu bytes)\n", cbOne, cbTotal);
break;
}
}
/*
* Free up some memory before displaying the results.
*/
size_t i = 0;
{
if (++i > 32)
break;
}
}
{
if (rcExit != RTEXITCODE_SUCCESS)
return rcExit;
if (argc == 1)
else
return RTTestSummaryAndDestroy(hTest);
}