kernel/acpica/compiler/aslparseop.c
/*******************************************************************************
 *
 * FUNCTION:    TrGetOpFromCache
 *
 * PARAMETERS:  None
 *
 * RETURN:      New parse op. Aborts on allocation failure
 *
 * DESCRIPTION: Allocate a new parse op for the parse tree. Bypass the local
 *              dynamic memory manager for performance reasons (This has a
 *              major impact on the speed of the compiler.)
 *
 ******************************************************************************/


New parse op. Aborts on allocation failure

Allocate a new parse op for the parse tree. Bypass the local
dynamic memory manager for performance reasons (This has a
major impact on the speed of the compiler.)
New parse op . Aborts on allocation failure Allocate a new parse op for the parse tree . Bypass the local dynamic memory manager for performance reasons ( This has a major impact on the speed of the compiler . )
static ACPI_PARSE_OBJECT *
TrGetOpFromCache (
    void)
{
    ASL_CACHE_INFO          *Cache;
    if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast)
    {
        Cache = UtLocalCalloc (sizeof (Cache->Next) +
            (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE));
        Cache->Next = Gbl_ParseOpCacheList;
        Gbl_ParseOpCacheList = Cache;
        Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer);
        Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE;
    }
    Gbl_ParseOpCount++;
    return (Gbl_ParseOpCacheNext++);
}
static ACPI_PARSE_OBJECT * TrGetOpFromCache ( void ) { ASL_CACHE_INFO * Cache ; if ( Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast ) { Cache = UtLocalCalloc ( sizeof ( Cache -> Next ) + ( sizeof ( ACPI_PARSE_OBJECT ) * ASL_PARSEOP_CACHE_SIZE ) ) ; Cache -> Next = Gbl_ParseOpCacheList ; Gbl_ParseOpCacheList = Cache ; Gbl_ParseOpCacheNext = ACPI_CAST_PTR ( ACPI_PARSE_OBJECT , Cache -> Buffer ) ; Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE ; } Gbl_ParseOpCount ++ ; return ( Gbl_ParseOpCacheNext ++ ) ; }
FUNCTION:    TrGetOpFromCache
 PARAMETERS:  None
FUNCTION : TrGetOpFromCache PARAMETERS : None
/* Allocate a new buffer */ /* Link new cache buffer to head of list */ /* Setup cache management pointers */