mirror of
https://github.com/acpica/acpica/
synced 2025-02-24 09:24:08 +03:00
Additional optimization of the ACPI_OPERAND_OBJECT
date 2000.08.31.16.29.00; author rmoore1; state Exp;
This commit is contained in:
parent
915ddc4a50
commit
7fb1dd2a99
@ -1,7 +1,7 @@
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*
|
*
|
||||||
* Module Name: cmobject - ACPI object create/delete/size/cache routines
|
* Module Name: cmobject - ACPI object create/delete/size/cache routines
|
||||||
* $Revision: 1.26 $
|
* $Revision: 1.27 $
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
@ -296,8 +296,8 @@ _CmAllocateObjectDesc (
|
|||||||
/* There is an object available, use it */
|
/* There is an object available, use it */
|
||||||
|
|
||||||
Object = AcpiGbl_ObjectCache;
|
Object = AcpiGbl_ObjectCache;
|
||||||
AcpiGbl_ObjectCache = Object->Common.Next;
|
AcpiGbl_ObjectCache = Object->Cache.Next;
|
||||||
Object->Common.Next = NULL;
|
Object->Cache.Next = NULL;
|
||||||
|
|
||||||
AcpiGbl_ObjectCacheHits++;
|
AcpiGbl_ObjectCacheHits++;
|
||||||
AcpiGbl_ObjectCacheDepth--;
|
AcpiGbl_ObjectCacheDepth--;
|
||||||
@ -361,6 +361,16 @@ AcpiCmDeleteObjectDesc (
|
|||||||
FUNCTION_TRACE ("AcpiCmDeleteObjectDesc");
|
FUNCTION_TRACE ("AcpiCmDeleteObjectDesc");
|
||||||
|
|
||||||
|
|
||||||
|
/* Make sure that the object isn't already in the cache */
|
||||||
|
|
||||||
|
if (Object->Common.DataType == (ACPI_DESC_TYPE_INTERNAL | ACPI_CACHED_OBJECT))
|
||||||
|
{
|
||||||
|
DEBUG_PRINT (ACPI_ERROR,
|
||||||
|
("CmDeleteObjectDesc: Obj %p is already in the object cache\n",
|
||||||
|
Object));
|
||||||
|
return_VOID;
|
||||||
|
}
|
||||||
|
|
||||||
/* Object must be an ACPI_OPERAND_OBJECT */
|
/* Object must be an ACPI_OPERAND_OBJECT */
|
||||||
|
|
||||||
if (Object->Common.DataType != ACPI_DESC_TYPE_INTERNAL)
|
if (Object->Common.DataType != ACPI_DESC_TYPE_INTERNAL)
|
||||||
@ -370,22 +380,6 @@ AcpiCmDeleteObjectDesc (
|
|||||||
return_VOID;
|
return_VOID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure that the object isn't already in the cache */
|
|
||||||
|
|
||||||
if (Object->Common.Next)
|
|
||||||
{
|
|
||||||
/* Some objects actually use the Next link field */
|
|
||||||
|
|
||||||
if ((Object->Common.Type != ACPI_TYPE_REGION) &&
|
|
||||||
(Object->Common.Type != INTERNAL_TYPE_ADDRESS_HANDLER))
|
|
||||||
{
|
|
||||||
DEBUG_PRINT (ACPI_ERROR,
|
|
||||||
("CmDeleteObjectDesc: Obj %p is already in the object cache\n",
|
|
||||||
Object));
|
|
||||||
return_VOID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* If cache is full, just free this object */
|
/* If cache is full, just free this object */
|
||||||
|
|
||||||
@ -406,11 +400,11 @@ AcpiCmDeleteObjectDesc (
|
|||||||
/* Clear the entire object. This is important! */
|
/* Clear the entire object. This is important! */
|
||||||
|
|
||||||
MEMSET (Object, 0, sizeof (ACPI_OPERAND_OBJECT));
|
MEMSET (Object, 0, sizeof (ACPI_OPERAND_OBJECT));
|
||||||
Object->Common.DataType = ACPI_DESC_TYPE_INTERNAL;
|
Object->Common.DataType = ACPI_DESC_TYPE_INTERNAL | ACPI_CACHED_OBJECT;
|
||||||
|
|
||||||
/* Put the object at the head of the global cache list */
|
/* Put the object at the head of the global cache list */
|
||||||
|
|
||||||
Object->Common.Next = AcpiGbl_ObjectCache;
|
Object->Cache.Next = AcpiGbl_ObjectCache;
|
||||||
AcpiGbl_ObjectCache = Object;
|
AcpiGbl_ObjectCache = Object;
|
||||||
AcpiGbl_ObjectCacheDepth++;
|
AcpiGbl_ObjectCacheDepth++;
|
||||||
|
|
||||||
@ -449,8 +443,8 @@ AcpiCmDeleteObjectCache (
|
|||||||
{
|
{
|
||||||
/* Delete one cached state object */
|
/* Delete one cached state object */
|
||||||
|
|
||||||
Next = AcpiGbl_ObjectCache->Common.Next;
|
Next = AcpiGbl_ObjectCache->Cache.Next;
|
||||||
AcpiGbl_ObjectCache->Common.Next = NULL;
|
AcpiGbl_ObjectCache->Cache.Next = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Memory allocation metrics. Call the macro here since we only
|
* Memory allocation metrics. Call the macro here since we only
|
||||||
|
Loading…
x
Reference in New Issue
Block a user