diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-04-12 11:45:44 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-04-12 11:45:44 +0300 |
commit | 8f83ab76a1d8861d9a992290f2691443d5169c89 (patch) | |
tree | ab97e5c6532b812c681121127694d6ece4a2e92d /awk.h | |
parent | 6ba1d42808efba4f381aaeec54211a7802b816ff (diff) | |
parent | 906ac1a525dd0f7ad87bafdaf882323938842760 (diff) | |
download | egawk-8f83ab76a1d8861d9a992290f2691443d5169c89.tar.gz egawk-8f83ab76a1d8861d9a992290f2691443d5169c89.tar.bz2 egawk-8f83ab76a1d8861d9a992290f2691443d5169c89.zip |
Merge branch 'master' into feature/stringfix
Diffstat (limited to 'awk.h')
-rw-r--r-- | awk.h | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -597,8 +597,7 @@ typedef enum lintvals { /* --------------------------------Instruction ---------------------------------- */ typedef enum opcodeval { - /* illegal entry == 0 */ - Op_illegal, + Op_illegal = 0, /* illegal entry */ /* binary operators */ Op_times, @@ -783,6 +782,7 @@ typedef struct exp_instruction { } x; short source_line; + short pool_size; // memory management in symbol.c OPCODE opcode; } INSTRUCTION; @@ -1031,9 +1031,19 @@ typedef struct srcfile { int lasttok; } SRCFILE; +// structure for INSTRUCTION pool, needed mainly for debugger +typedef struct instruction_pool { +#define MAX_INSTRUCTION_ALLOC 3 // we don't call bcalloc with more than this + struct instruction_mem_pool { + struct instruction_block *block_list; + INSTRUCTION *free_space; // free location in active block + INSTRUCTION *free_list; + } pool[MAX_INSTRUCTION_ALLOC]; +} INSTRUCTION_POOL; + /* structure for execution context */ typedef struct context { - INSTRUCTION pools; + INSTRUCTION_POOL pools; NODE symbols; INSTRUCTION rule_list; SRCFILE srcfiles; |