aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-05-31 11:16:06 +0200
committerLukas Larsson <[email protected]>2013-05-31 11:16:06 +0200
commit04b4086965b628c43d31eec3063e2d614914276b (patch)
tree96436c96bfb430cbe246c1a5888b451dea00de06 /erts/preloaded/src
parent9226ff2e22e6e17594f26db4d3e7a9e67c869007 (diff)
parentdf4fe8fac6425a85c5366e540b588b6e084ca798 (diff)
downloadotp-04b4086965b628c43d31eec3063e2d614914276b.tar.gz
otp-04b4086965b628c43d31eec3063e2d614914276b.tar.bz2
otp-04b4086965b628c43d31eec3063e2d614914276b.zip
Merge branch 'maint'
* maint: Replace gc stat lock with sched spec data Conflicts: erts/preloaded/ebin/erlang.beam
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r--erts/preloaded/src/erlang.erl20
1 files changed, 19 insertions, 1 deletions
diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl
index 7106c0a4fb..6929ca3fa5 100644
--- a/erts/preloaded/src/erlang.erl
+++ b/erts/preloaded/src/erlang.erl
@@ -45,7 +45,8 @@
-export([alloc_info/1, alloc_sizes/1]).
-export([gather_sched_wall_time_result/1,
- await_sched_wall_time_modifications/2]).
+ await_sched_wall_time_modifications/2,
+ gather_gc_info_result/1]).
-deprecated([hash/2]).
@@ -3536,3 +3537,20 @@ sched_wall_time(Ref, N, Acc) ->
{Ref, undefined} -> sched_wall_time(Ref, N-1, undefined);
{Ref, SWT} -> sched_wall_time(Ref, N-1, [SWT|Acc])
end.
+
+-spec erlang:gather_gc_info_result(Ref) -> [{pos_integer(),
+ pos_integer(),
+ 0}] when
+ Ref :: reference().
+
+gather_gc_info_result(Ref) when erlang:is_reference(Ref) ->
+ gc_info(Ref, erlang:system_info(schedulers), {0,0}).
+
+gc_info(_Ref, 0, {Colls,Recl}) ->
+ {Colls,Recl,0};
+gc_info(Ref, N, {OrigColls,OrigRecl}) ->
+ receive
+ {Ref, {_,Colls, Recl}} ->
+ gc_info(Ref, N-1, {Colls+OrigColls,Recl+OrigRecl})
+ end.
+