FreeBSD/sys/contrib/dev/acpica/compiler/dtutils.c
/*******************************************************************************
 *
 * FUNCTION:    UtSubtableCacheCalloc
 *
 * PARAMETERS:  None
 *
 * RETURN:      Pointer to the buffer. Aborts on allocation failure
 *
 * DESCRIPTION: Allocate a subtable object buffer. Bypass the local
 *              dynamic memory manager for performance reasons (This has a
 *              major impact on the speed of the compiler.)
 *
 ******************************************************************************/


Pointer to the buffer. Aborts on allocation failure

Allocate a subtable object buffer. Bypass the local
dynamic memory manager for performance reasons (This has a
major impact on the speed of the compiler.)
Pointer to the buffer . Aborts on allocation failure Allocate a subtable object buffer . Bypass the local dynamic memory manager for performance reasons ( This has a major impact on the speed of the compiler . )
DT_SUBTABLE *
UtSubtableCacheCalloc (
    void)
{
    ASL_CACHE_INFO          *Cache;
    if (Gbl_SubtableCacheNext >= Gbl_SubtableCacheLast)
    {
        Cache = UtLocalCalloc (sizeof (Cache->Next) +
            (sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE));
        Cache->Next = Gbl_SubtableCacheList;
        Gbl_SubtableCacheList = Cache;
        Gbl_SubtableCacheNext = ACPI_CAST_PTR (DT_SUBTABLE, Cache->Buffer);
        Gbl_SubtableCacheLast = Gbl_SubtableCacheNext + ASL_SUBTABLE_CACHE_SIZE;
    }
    Gbl_SubtableCount++;
    return (Gbl_SubtableCacheNext++);
}
DT_SUBTABLE * UtSubtableCacheCalloc ( void ) { ASL_CACHE_INFO * Cache ; if ( Gbl_SubtableCacheNext >= Gbl_SubtableCacheLast ) { Cache = UtLocalCalloc ( sizeof ( Cache -> Next ) + ( sizeof ( DT_SUBTABLE ) * ASL_SUBTABLE_CACHE_SIZE ) ) ; Cache -> Next = Gbl_SubtableCacheList ; Gbl_SubtableCacheList = Cache ; Gbl_SubtableCacheNext = ACPI_CAST_PTR ( DT_SUBTABLE , Cache -> Buffer ) ; Gbl_SubtableCacheLast = Gbl_SubtableCacheNext + ASL_SUBTABLE_CACHE_SIZE ; } Gbl_SubtableCount ++ ; return ( Gbl_SubtableCacheNext ++ ) ; }
FUNCTION:    UtSubtableCacheCalloc
 PARAMETERS:  None
FUNCTION : UtSubtableCacheCalloc PARAMETERS : None
/* Allocate a new buffer */ /* Link new cache buffer to head of list */ /* Setup cache management pointers */