aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-11-22 16:02:27 +0100
committerSverker Eriksson <[email protected]>2018-11-22 16:02:27 +0100
commit253d146786dc2068de724bb36f61d6d24c4d460b (patch)
tree81df6b72154b7998c64c6317ab4c64e447cfdf22 /erts/preloaded
parenta411b7dedd42cc4cbe160eec3e5aae8027e7833b (diff)
parentfb8018f9ebebbcb5ef074e33514a4c03aaefbe2d (diff)
downloadotp-253d146786dc2068de724bb36f61d6d24c4d460b.tar.gz
otp-253d146786dc2068de724bb36f61d6d24c4d460b.tar.bz2
otp-253d146786dc2068de724bb36f61d6d24c4d460b.zip
Merge branch 'maint'
Diffstat (limited to 'erts/preloaded')
-rw-r--r--erts/preloaded/ebin/counters.beambin2808 -> 3140 bytes
-rw-r--r--erts/preloaded/ebin/erts_internal.beambin17444 -> 17572 bytes
-rw-r--r--erts/preloaded/src/counters.erl14
-rw-r--r--erts/preloaded/src/erts_internal.erl6
4 files changed, 19 insertions, 1 deletions
diff --git a/erts/preloaded/ebin/counters.beam b/erts/preloaded/ebin/counters.beam
index caaa6167e1..4e1a3566f7 100644
--- a/erts/preloaded/ebin/counters.beam
+++ b/erts/preloaded/ebin/counters.beam
Binary files differ
diff --git a/erts/preloaded/ebin/erts_internal.beam b/erts/preloaded/ebin/erts_internal.beam
index 2b98e87843..543104638b 100644
--- a/erts/preloaded/ebin/erts_internal.beam
+++ b/erts/preloaded/ebin/erts_internal.beam
Binary files differ
diff --git a/erts/preloaded/src/counters.erl b/erts/preloaded/src/counters.erl
index 67354f648d..a0e3035e0f 100644
--- a/erts/preloaded/src/counters.erl
+++ b/erts/preloaded/src/counters.erl
@@ -26,6 +26,7 @@
get/2,
add/3,
sub/3,
+ put/3,
info/1]).
-export_type([counters_ref/0]).
@@ -76,6 +77,19 @@ add(_, _, _) ->
sub(Ref, Ix, Decr) ->
add(Ref, Ix, -Decr).
+
+-spec put(Ref, Ix, Value) -> ok when
+ Ref :: counters_ref(),
+ Ix :: integer(),
+ Value :: integer().
+put({atomics, Ref}, Ix, Value) ->
+ atomics:put(Ref, Ix, Value);
+put({write_concurrency, Ref}, Ix, Value) ->
+ erts_internal:counters_put(Ref, Ix, Value);
+put(_, _, _) ->
+ erlang:error(badarg).
+
+
-spec info(Ref) -> Info when
Ref :: counters_ref(),
Info :: #{'size':=Size, 'memory':=Memory},
diff --git a/erts/preloaded/src/erts_internal.erl b/erts/preloaded/src/erts_internal.erl
index d491a505c6..8f29a569f2 100644
--- a/erts/preloaded/src/erts_internal.erl
+++ b/erts/preloaded/src/erts_internal.erl
@@ -95,7 +95,7 @@
-export([atomics_new/2]).
-export([counters_new/1, counters_get/2, counters_add/3,
- counters_info/1]).
+ counters_put/3, counters_info/1]).
%%
%% Await result of send to port
@@ -719,6 +719,10 @@ counters_get(_Ref, _Ix) ->
counters_add(_Ref, _Ix, _Incr) ->
erlang:nif_error(undef).
+-spec counters_put(reference(), pos_integer(), integer()) -> ok.
+counters_put(_Ref, _Ix, _Value) ->
+ erlang:nif_error(undef).
+
-spec counters_info(reference()) -> #{}.
counters_info(_Ref) ->
erlang:nif_error(undef).