aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index 8127ece4..8c3740b3 100644
--- a/src/library.js
+++ b/src/library.js
@@ -3143,7 +3143,9 @@ LibraryManager.library = {
// stdlib.h
// ==========================================================================
- malloc: Runtime.staticAlloc,
+ malloc: function(bytes) {
+ return Runtime.staticAlloc(bytes || 1); // accept 0 as an input because libc implementations tend to
+ },
_Znwj: 'malloc',
_Znaj: 'malloc',
_Znam: 'malloc',