summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-01 09:15:04 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-01 09:15:04 -0800
commit04ed380c4a389c0c21eae8e3cd35e7e44506a2e3 (patch)
tree18f2c304931497d21767eb37050b1753091623eb /txr.c
parentdd40488f746cab80f33a4a30508afc4d7ace1516 (diff)
downloadtxr-04ed380c4a389c0c21eae8e3cd35e7e44506a2e3.tar.gz
txr-04ed380c4a389c0c21eae8e3cd35e7e44506a2e3.tar.bz2
txr-04ed380c4a389c0c21eae8e3cd35e7e44506a2e3.zip
Bug ID 27899: Garbage collection problem: method of locating stack
bottom is unreliable due to the unpredictable allocation order of local variables.
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/txr.c b/txr.c
index b2097b82..d369816f 100644
--- a/txr.c
+++ b/txr.c
@@ -133,17 +133,23 @@ obj_t *remove_hash_bang_line(obj_t *spec)
}
}
+static int txr_main(int argc, char **argv);
+
int main(int argc, char **argv)
{
- obj_t *stack_bottom_0 = nil;
+ obj_t *stack_bottom = nil;
+ progname = argv[0] ? argv[0] : progname;
+ init(progname, oom_realloc_handler, &stack_bottom);
+ return txr_main(argc, argv);
+}
+
+static int txr_main(int argc, char **argv)
+{
obj_t *specstring = nil;
obj_t *spec = nil;
obj_t *bindings = nil;
int match_loglevel = opt_loglevel;
progname = argv[0] ? argv[0] : progname;
- obj_t *stack_bottom_1 = nil;
-
- init(progname, oom_realloc_handler, &stack_bottom_0, &stack_bottom_1);
protect(&spec_file_str, 0);