aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-03 18:22:37 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-03 18:22:37 -0700
commitaf7dedb9be77ed2ce6bc3b14d2a250c0e233ce4d (patch)
tree2d637333a4095ac4959685af6b33613cb5ce3507
parent60faa96b411e8427c4dcb19720bffbe3a73e9f7b (diff)
show stub malloc/free warnings only in ASSERTIONS==2
-rw-r--r--src/library.js4
-rw-r--r--src/settings.js1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js
index 5e2cb482..dcfe333c 100644
--- a/src/library.js
+++ b/src/library.js
@@ -3798,14 +3798,14 @@ LibraryManager.library = {
* implementation (replaced by dlmalloc normally) so
* not an issue.
*/
-#if ASSERTIONS
+#if ASSERTIONS == 2
Runtime.warnOnce('using stub malloc (reference it from C to have the real one included)');
#endif
var ptr = Runtime.dynamicAlloc(bytes + 8);
return (ptr+8) & 0xFFFFFFF8;
},
free: function() {
-#if ASSERTIONS
+#if ASSERTIONS == 2
Runtime.warnOnce('using stub free (reference it from C to have the real one included)');
#endif
},
diff --git a/src/settings.js b/src/settings.js
index c156a40c..52605bda 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -36,6 +36,7 @@ var ASSERTIONS = 1; // Whether we should add runtime assertions, for example to
// exceed it's size, whether all allocations (stack and static) are
// of positive size, etc., whether we should throw if we encounter a bad __label__, i.e.,
// if code flow runs into a fault
+ // ASSERTIONS == 2 gives even more runtime checks
var VERBOSE = 0; // When set to 1, will generate more verbose output during compilation.
var INVOKE_RUN = 1; // Whether we will run the main() function. Disable if you embed the generated