Merge pull request #4057 from zmstone/fix-emqx_vm-allocator-info-otp-23-compatibility
fix emqx_vm allocator info otp 23 compatibility
This commit is contained in:
commit
6a6a94f99e
|
@ -1,5 +1,5 @@
|
||||||
{deps, [
|
{deps, [
|
||||||
{recon, {git, "https://github.com/ferd/recon", {tag, "2.5.0"}}}
|
%% recon "https://github.com/ferd/recon" at root rebar.config
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{edoc_opts, [{preprocess, true}]}.
|
{edoc_opts, [{preprocess, true}]}.
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
, {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {branch, "2.0.4"}}}
|
, {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {branch, "2.0.4"}}}
|
||||||
, {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.3"}}}
|
, {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.3"}}}
|
||||||
, {rulesql, {git, "https://github.com/emqx/rulesql", {tag, "0.1.2"}}}
|
, {rulesql, {git, "https://github.com/emqx/rulesql", {tag, "0.1.2"}}}
|
||||||
|
, {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}}
|
||||||
, {getopt, "1.0.1"}
|
, {getopt, "1.0.1"}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
|
|
|
@ -275,14 +275,8 @@ util_alloc()->
|
||||||
alloc(?UTIL_ALLOCATORS).
|
alloc(?UTIL_ALLOCATORS).
|
||||||
|
|
||||||
alloc(Type) ->
|
alloc(Type) ->
|
||||||
[{{T, Instance}, Props} || {{T, Instance}, Props} <- allocators(), lists:member(T, Type)].
|
[{{T, Instance}, Props} ||
|
||||||
|
{{T, Instance}, Props} <- recon_alloc:allocators(), lists:member(T, Type)].
|
||||||
allocators() ->
|
|
||||||
UtilAllocators = erlang:system_info(alloc_util_allocators),
|
|
||||||
Allocators = [sys_alloc, mseg_alloc|UtilAllocators],
|
|
||||||
[{{A, N}, lists:sort(proplists:delete(versions, Props))} ||
|
|
||||||
A <- Allocators, Allocs <- [erlang:system_info({allocator, A})],
|
|
||||||
Allocs =/= false, {_, N, Props} <- Allocs].
|
|
||||||
|
|
||||||
container_size(Prop, Keyword, Container) ->
|
container_size(Prop, Keyword, Container) ->
|
||||||
Sbcs = container_value(Prop, Keyword, sbcs, Container),
|
Sbcs = container_value(Prop, Keyword, sbcs, Container),
|
||||||
|
|
Loading…
Reference in New Issue