aboutsummaryrefslogtreecommitdiffstats
path: root/awk.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-04-12 11:45:20 +0300
committerArnold D. Robbins <arnold@skeeve.com>2017-04-12 11:45:20 +0300
commit3cb9f16bb195a3d004692e85e7f9190a9469fcb1 (patch)
treef82ea305b818d0af77cd0e28dd2c3c470985d6ee /awk.h
parent1be20bcb0e717e35a6de5074223252f2eb1c5aa5 (diff)
parent906ac1a525dd0f7ad87bafdaf882323938842760 (diff)
downloadegawk-3cb9f16bb195a3d004692e85e7f9190a9469fcb1.tar.gz
egawk-3cb9f16bb195a3d004692e85e7f9190a9469fcb1.tar.bz2
egawk-3cb9f16bb195a3d004692e85e7f9190a9469fcb1.zip
Merge branch 'master' into feature/fix-comments
Diffstat (limited to 'awk.h')
-rw-r--r--awk.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/awk.h b/awk.h
index ab744f1d..2f82ba0f 100644
--- a/awk.h
+++ b/awk.h
@@ -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;