diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2014-09-11 21:38:09 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2014-09-11 21:38:09 +0000 |
commit | 754171ae60abbbd707ed8d449f07ef38f596bd22 (patch) | |
tree | 67d2b76905535d056ba6911186285d0325dc703f /source/compiler/asltree.c | |
parent | e599b42ef5047e5546af949d87d2cfd2e17062b0 (diff) |
Notes
Diffstat (limited to 'source/compiler/asltree.c')
-rw-r--r-- | source/compiler/asltree.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c index 0ea4528baf667..cd84d8bf5667c 100644 --- a/source/compiler/asltree.c +++ b/source/compiler/asltree.c @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "aslcompiler.h" #include "aslcompiler.y.h" #include "acapps.h" @@ -79,15 +78,29 @@ static ACPI_PARSE_OBJECT * TrGetNextNode ( void) { + ASL_CACHE_INFO *Cache; + - if (Gbl_NodeCacheNext >= Gbl_NodeCacheLast) + if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast) { - Gbl_NodeCacheNext = UtLocalCalloc (sizeof (ACPI_PARSE_OBJECT) * - ASL_NODE_CACHE_SIZE); - Gbl_NodeCacheLast = Gbl_NodeCacheNext + ASL_NODE_CACHE_SIZE; + /* Allocate a new buffer */ + + Cache = UtLocalCalloc (sizeof (Cache->Next) + + (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE)); + + /* Link new cache buffer to head of list */ + + Cache->Next = Gbl_ParseOpCacheList; + Gbl_ParseOpCacheList = Cache; + + /* Setup cache management pointers */ + + Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer); + Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE; } - return (Gbl_NodeCacheNext++); + Gbl_ParseOpCount++; + return (Gbl_ParseOpCacheNext++); } |