FreeBSD/sys/contrib/dev/acpica/compiler/dtutils.c
/*******************************************************************************
 *
 * FUNCTION:    UtFieldCacheCalloc
 *
 * PARAMETERS:  None
 *
 * RETURN:      Pointer to the buffer. Aborts on allocation failure
 *
 * DESCRIPTION: Allocate a field 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 field 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 field object buffer . Bypass the local dynamic memory manager for performance reasons ( This has a major impact on the speed of the compiler . )
DT_FIELD *
UtFieldCacheCalloc (
    void)
{
    ASL_CACHE_INFO          *Cache;
    if (Gbl_FieldCacheNext >= Gbl_FieldCacheLast)
    {
        Cache = UtLocalCalloc (sizeof (Cache->Next) +
            (sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE));
        Cache->Next = Gbl_FieldCacheList;
        Gbl_FieldCacheList = Cache;
        Gbl_FieldCacheNext = ACPI_CAST_PTR (DT_FIELD, Cache->Buffer);
        Gbl_FieldCacheLast = Gbl_FieldCacheNext + ASL_FIELD_CACHE_SIZE;
    }
    Gbl_FieldCount++;
    return (Gbl_FieldCacheNext++);
}
DT_FIELD * UtFieldCacheCalloc ( void ) { ASL_CACHE_INFO * Cache ; if ( Gbl_FieldCacheNext >= Gbl_FieldCacheLast ) { Cache = UtLocalCalloc ( sizeof ( Cache -> Next ) + ( sizeof ( DT_FIELD ) * ASL_FIELD_CACHE_SIZE ) ) ; Cache -> Next = Gbl_FieldCacheList ; Gbl_FieldCacheList = Cache ; Gbl_FieldCacheNext = ACPI_CAST_PTR ( DT_FIELD , Cache -> Buffer ) ; Gbl_FieldCacheLast = Gbl_FieldCacheNext + ASL_FIELD_CACHE_SIZE ; } Gbl_FieldCount ++ ; return ( Gbl_FieldCacheNext ++ ) ; }
FUNCTION:    UtFieldCacheCalloc
 PARAMETERS:  None
FUNCTION : UtFieldCacheCalloc PARAMETERS : None
/* Allocate a new buffer */ /* Link new cache buffer to head of list */ /* Setup cache management pointers */