fix(emqx_vm): Call recon_alloc:allocators/0 to get allocators

This commit is contained in:
Zaiming Shi 2021-01-23 11:00:41 +01:00
parent 17d70772a8
commit de972b3d84
1 changed files with 2 additions and 8 deletions

View File

@ -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),