aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2019-01-20 10:49:49 +0000
committerbloodstalker <thabogre@gmail.com>2019-01-20 10:49:49 +0000
commitc5bef8e4558bc5e6ddc378847a8d10a573d819aa (patch)
treeb177e9f0efa5b42e2eeeee59651e7a481f18a8df
parentfix (diff)
downloadfaultreiber-c5bef8e4558bc5e6ddc378847a8d10a573d819aa.tar.gz
faultreiber-c5bef8e4558bc5e6ddc378847a8d10a573d819aa.zip
update
Diffstat (limited to '')
-rwxr-xr-xmain.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/main.py b/main.py
index 27b0b21..9174ec5 100755
--- a/main.py
+++ b/main.py
@@ -721,12 +721,15 @@ class CodeGen(object):
def gen_release(self):
agg_source = open(self.aggregate_source, "a")
agg_source_h = open(self.aggregate_source_h, "a")
- agg_source_h.write("void release_all_"+self.argparser.args.name+"(void** void_train, uint64_t current_void_count);\n")
- agg_source.write("void release_all_"+self.argparser.args.name+"(void** void_train, uint64_t current_void_count) {\n")
- agg_source.write("for (int i=current_void_count-1;i>=0;--i) {\n")
- agg_source.write("free(void_train[i]);\n}\n")
- agg_source.write("free(void_train);\n")
- agg_source.write("}\n")
+ if self.argparser.args.luaalloc:
+ pass
+ else:
+ agg_source_h.write("void release_all_"+self.argparser.args.name+"(void** void_train, uint64_t current_void_count);\n")
+ agg_source.write("void release_all_"+self.argparser.args.name+"(void** void_train, uint64_t current_void_count) {\n")
+ agg_source.write("for (int i=current_void_count-1;i>=0;--i) {\n")
+ agg_source.write("free(void_train[i]);\n}\n")
+ agg_source.write("free(void_train);\n")
+ agg_source.write("}\n")
agg_source_h.write('#ifdef __cplusplus\n}\n#endif\n')
agg_source_h.write("#endif //end of header guard\n\n")