nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39ef9d0
)
emscripten: add GC controls
author
Alexis Laferrière
<alexis.laf@xymus.net>
Thu, 26 Jun 2014 16:11:18 +0000
(12:11 -0400)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Thu, 26 Jun 2014 19:34:37 +0000
(15:34 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/emscripten.nit
patch
|
blob
|
history
diff --git
a/lib/emscripten.nit
b/lib/emscripten.nit
index
7fc5e76
..
d46f4d1
100644
(file)
--- a/
lib/emscripten.nit
+++ b/
lib/emscripten.nit
@@
-18,6
+18,7
@@
module emscripten is platform
`{
#include <emscripten.h>
+ #include <gc.h>
`}
redef class String
@@
-28,3
+29,10
@@
redef class String
fun alert do "alert('{self.escape_to_js}')".run_js
end
+
+redef class Sys
+ redef fun force_garbage_collection `{ GC_FORCE_COLLECT(); `}
+
+ # The emscripten GC *must* be manually invoked, it will not act by itself
+ fun suggest_garbage_collection `{ GC_MAYBE_COLLECT(); `}
+end