Skip to content

Commit

Permalink
Added erlv8.gc() function
Browse files Browse the repository at this point in the history
  • Loading branch information
yrashk committed Jan 16, 2011
1 parent 8cb1aa8 commit ba3d1d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/beamjs_mod_erlv8.erl
Expand Up @@ -8,7 +8,8 @@ init(_VM) ->

exports(_VM) ->
?V8Obj([{"nextTick",fun next_tick/2},
{"enqueueTick", fun enqueue_tick/2}
{"enqueueTick", fun enqueue_tick/2},
{"gc", fun gc/2}
]).

next_tick(#erlv8_fun_invocation{ vm = VM },[#erlv8_fun{ resource = R }=F]) ->
Expand All @@ -18,4 +19,7 @@ next_tick(#erlv8_fun_invocation{ vm = VM },[#erlv8_fun{ resource = R }=F]) ->
enqueue_tick(#erlv8_fun_invocation{ vm = VM },[#erlv8_fun{ resource = R }=F]) ->
spawn(fun () -> erlv8_vm:enqueue_tick(VM, {call, R, []}) end),
F.

gc(#erlv8_fun_invocation{ vm = VM },[]) ->
erlv8_vm:gc(VM).

0 comments on commit ba3d1d3

Please sign in to comment.