aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-05-31 11:06:56 +0200
committerLukas Larsson <[email protected]>2013-05-31 11:11:16 +0200
commitdf4fe8fac6425a85c5366e540b588b6e084ca798 (patch)
tree0268066840508ced6b79caba4eaf5c23ce15a0e0 /erts/preloaded
parent9427db3cd66f840ade9649513d914271b0981bf4 (diff)
parentfb4440038ea305929d7f46c0ea651994b412483f (diff)
downloadotp-df4fe8fac6425a85c5366e540b588b6e084ca798.tar.gz
otp-df4fe8fac6425a85c5366e540b588b6e084ca798.tar.bz2
otp-df4fe8fac6425a85c5366e540b588b6e084ca798.zip
Merge branch 'lukas/erts/gc_stat_contention/OTP-10271' into maint
* lukas/erts/gc_stat_contention/OTP-10271: Replace gc stat lock with sched spec data
Diffstat (limited to 'erts/preloaded')
-rw-r--r--erts/preloaded/ebin/erlang.beambin92912 -> 93520 bytes
-rw-r--r--erts/preloaded/src/erlang.erl20
2 files changed, 19 insertions, 1 deletions
diff --git a/erts/preloaded/ebin/erlang.beam b/erts/preloaded/ebin/erlang.beam
index 308cb99be5..315f9ebd47 100644
--- a/erts/preloaded/ebin/erlang.beam
+++ b/erts/preloaded/ebin/erlang.beam
Binary files differ
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.
+