|
| 1 | +#include "express/memory.h" |
| 2 | + |
| 3 | +#include "express/alloc.h" |
| 4 | + |
| 5 | +#include "express/hash.h" |
| 6 | +#include "express/symbol.h" |
| 7 | +#include "express/schema.h" |
| 8 | +#include "express/type.h" |
| 9 | + |
| 10 | +struct freelist_head HASH_Table_fl; |
| 11 | +struct freelist_head HASH_Element_fl; |
| 12 | + |
| 13 | +struct freelist_head LINK_fl; |
| 14 | +struct freelist_head LIST_fl; |
| 15 | + |
| 16 | +struct freelist_head ERROR_OPT_fl; |
| 17 | + |
| 18 | +struct freelist_head SYMBOL_fl; |
| 19 | + |
| 20 | +struct freelist_head SCOPE_fl; |
| 21 | +struct freelist_head SCHEMA_fl; |
| 22 | + |
| 23 | +struct freelist_head TYPEHEAD_fl; |
| 24 | +struct freelist_head TYPEBODY_fl; |
| 25 | + |
| 26 | +struct freelist_head VAR_fl; |
| 27 | + |
| 28 | +struct freelist_head FUNC_fl; |
| 29 | +struct freelist_head RULE_fl; |
| 30 | +struct freelist_head PROC_fl; |
| 31 | +struct freelist_head WHERE_fl; |
| 32 | + |
| 33 | +struct freelist_head ENTITY_fl; |
| 34 | + |
| 35 | +struct freelist_head CASE_IT_fl; |
| 36 | + |
| 37 | +struct freelist_head EXP_fl; |
| 38 | +struct freelist_head OP_fl; |
| 39 | +struct freelist_head QUERY_fl; |
| 40 | +struct freelist_head QUAL_ATTR_fl; |
| 41 | + |
| 42 | +struct freelist_head STMT_fl; |
| 43 | +struct freelist_head ALIAS_fl; |
| 44 | +struct freelist_head ASSIGN_fl; |
| 45 | +struct freelist_head CASE_fl; |
| 46 | +struct freelist_head COMP_STMT_fl; |
| 47 | +struct freelist_head COND_fl; |
| 48 | +struct freelist_head LOOP_fl; |
| 49 | +struct freelist_head PCALL_fl; |
| 50 | +struct freelist_head RET_fl; |
| 51 | +struct freelist_head INCR_fl; |
| 52 | + |
| 53 | +void MEMinit() { |
| 54 | + _ALLOCinitialize(); |
| 55 | + |
| 56 | + ALLOCinitialize( &HASH_Table_fl, sizeof( struct Hash_Table_ ), 50, 50 ); |
| 57 | + ALLOCinitialize( &HASH_Element_fl, sizeof( struct Element_ ), 500, 100 ); |
| 58 | + |
| 59 | + ALLOCinitialize( &LINK_fl, sizeof( struct Link_ ), 500, 100 ); |
| 60 | + ALLOCinitialize( &LIST_fl, sizeof( struct Linked_List_ ), 100, 50 ); |
| 61 | + |
| 62 | + ALLOCinitialize( &ERROR_OPT_fl, sizeof( struct Error_Warning_ ), 5, 5 ); |
| 63 | + |
| 64 | + ALLOCinitialize( &SYMBOL_fl, sizeof( struct Symbol_ ), 100, 100 ); |
| 65 | + |
| 66 | + ALLOCinitialize( &SCOPE_fl, sizeof( struct Scope_ ), 100, 50 ); |
| 67 | + |
| 68 | + ALLOCinitialize( &TYPEHEAD_fl, sizeof( struct TypeHead_ ), 500, 100 ); |
| 69 | + ALLOCinitialize( &TYPEBODY_fl, sizeof( struct TypeBody_ ), 200, 100 ); |
| 70 | + |
| 71 | + ALLOCinitialize( &VAR_fl, sizeof( struct Variable_ ), 100, 50 ); |
| 72 | + |
| 73 | + ALLOCinitialize( &FUNC_fl, sizeof( struct Function_ ), 100, 50 ); |
| 74 | + ALLOCinitialize( &RULE_fl, sizeof( struct Rule_ ), 100, 50 ); |
| 75 | + ALLOCinitialize( &PROC_fl, sizeof( struct Procedure_ ), 100, 50 ); |
| 76 | + ALLOCinitialize( &WHERE_fl, sizeof( struct Where_ ), 100, 50 ); |
| 77 | + |
| 78 | + ALLOCinitialize( &ENTITY_fl, sizeof( struct Entity_ ), 500, 100 ); |
| 79 | + |
| 80 | + ALLOCinitialize( &SCHEMA_fl, sizeof( struct Schema_ ), 40, 20 ); |
| 81 | + |
| 82 | + ALLOCinitialize( &CASE_IT_fl, sizeof( struct Case_Item_ ), 500, 100 ); |
| 83 | + |
| 84 | + ALLOCinitialize( &EXP_fl, sizeof( struct Expression_ ), 500, 200 ); |
| 85 | + ALLOCinitialize( &OP_fl, sizeof( struct Op_Subexpression ), 500, 100 ); |
| 86 | + ALLOCinitialize( &QUERY_fl, sizeof( struct Query_ ), 50, 10 ); |
| 87 | + ALLOCinitialize( &QUAL_ATTR_fl, sizeof( struct Query_ ), 20, 10 ); |
| 88 | + |
| 89 | + ALLOCinitialize( &STMT_fl, sizeof( struct Statement_ ), 500, 100 ); |
| 90 | + |
| 91 | + ALLOCinitialize( &ALIAS_fl, sizeof( struct Alias_ ), 10, 10 ); |
| 92 | + ALLOCinitialize( &ASSIGN_fl, sizeof( struct Assignment_ ), 100, 30 ); |
| 93 | + ALLOCinitialize( &CASE_fl, sizeof( struct Case_Statement_ ), 100, 30 ); |
| 94 | + ALLOCinitialize( &COMP_STMT_fl, sizeof( struct Compound_Statement_ ), 100, 30 ); |
| 95 | + ALLOCinitialize( &COND_fl, sizeof( struct Conditional_ ), 100, 30 ); |
| 96 | + ALLOCinitialize( &LOOP_fl, sizeof( struct Loop_ ), 100, 30 ); |
| 97 | + ALLOCinitialize( &PCALL_fl, sizeof( struct Procedure_Call_ ), 100, 30 ); |
| 98 | + ALLOCinitialize( &RET_fl, sizeof( struct Return_Statement_ ), 100, 30 ); |
| 99 | + ALLOCinitialize( &INCR_fl, sizeof( struct Increment_ ), 100, 30 ); |
| 100 | + |
| 101 | +} |
| 102 | + |
0 commit comments