diff options
Diffstat (limited to 'erts/emulator/beam/erl_bif_unique.c')
-rw-r--r-- | erts/emulator/beam/erl_bif_unique.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_bif_unique.c b/erts/emulator/beam/erl_bif_unique.c index 0deced34de..7b3b3746b1 100644 --- a/erts/emulator/beam/erl_bif_unique.c +++ b/erts/emulator/beam/erl_bif_unique.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2014-2021. All Rights Reserved. + * Copyright Ericsson AB 2014-2023. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -701,6 +701,27 @@ init_pid_ref_tables(void) } } + +Uint +erts_pid_ref_table_size(void) +{ + int i; + Uint sz = 0; + + for (i = 0; i <= erts_no_schedulers; i++) { + HashInfo hi; + ErtsPidRefTable *tblp = &pid_ref_table[i].u.table; + erts_rwmtx_rlock(&tblp->rwmtx); + hash_get_info(&hi, &tblp->hash); + erts_rwmtx_runlock(&tblp->rwmtx); + sz += (Uint) hi.objs; + } + + return sz; +} + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * Unique Integer * \* */ |