aboutsummaryrefslogtreecommitdiffstats
path: root/awk.h
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2017-04-07 11:30:22 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2017-04-07 11:30:22 -0400
commit22bfbd1057c2fa9d5e5b2401d6b1ab60737452d9 (patch)
tree3a86025ece2992cc35fa90448e3b06795cb41618 /awk.h
parent4eb9f5be22cc4e63d0ef360ea6ba2ac850d7293e (diff)
downloadegawk-22bfbd1057c2fa9d5e5b2401d6b1ab60737452d9.tar.gz
egawk-22bfbd1057c2fa9d5e5b2401d6b1ab60737452d9.tar.bz2
egawk-22bfbd1057c2fa9d5e5b2401d6b1ab60737452d9.zip
Patch INSTRUCTION allocator to malloc instruction blocks and eliminate leaks.
Diffstat (limited to 'awk.h')
-rw-r--r--awk.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/awk.h b/awk.h
index 6b7cdb7a..c7bfec2b 100644
--- a/awk.h
+++ b/awk.h
@@ -1035,7 +1035,11 @@ typedef struct 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
- INSTRUCTION pool[MAX_INSTRUCTION_ALLOC + 1];
+ 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 */