summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_bif_unique.h
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/erl_bif_unique.h')
-rw-r--r--erts/emulator/beam/erl_bif_unique.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/erts/emulator/beam/erl_bif_unique.h b/erts/emulator/beam/erl_bif_unique.h
index bcbcfaee0d..def05f0d53 100644
--- a/erts/emulator/beam/erl_bif_unique.h
+++ b/erts/emulator/beam/erl_bif_unique.h
@@ -40,9 +40,7 @@ void erts_make_magic_ref_in_array(Uint32 ref[ERTS_REF_NUMBERS]);
void erts_magic_ref_remove_bin(Uint32 refn[ERTS_REF_NUMBERS]);
void erts_magic_ref_save_bin__(Eterm ref);
ErtsMagicBinary *erts_magic_ref_lookup_bin__(Uint32 refn[ERTS_REF_NUMBERS]);
-void erts_pid_ref_delete(Eterm ref);
-Eterm erts_pid_ref_lookup__(Uint32 refn[ERTS_REF_NUMBERS]);
-Uint erts_pid_ref_table_size(void);
+
/* strict monotonic counter */
@@ -96,7 +94,7 @@ ERTS_GLB_INLINE Eterm erts_mk_magic_ref(Eterm **hpp, ErlOffHeap *ohp, Binary *mb
ERTS_GLB_INLINE Binary *erts_magic_ref2bin(Eterm mref);
ERTS_GLB_INLINE void erts_magic_ref_save_bin(Eterm ref);
ERTS_GLB_INLINE ErtsMagicBinary *erts_magic_ref_lookup_bin(Uint32 ref[ERTS_REF_NUMBERS]);
-ERTS_GLB_INLINE Eterm erts_pid_ref_lookup(Uint32 *refn);
+ERTS_GLB_INLINE Eterm erts_pid_ref_lookup(Uint32 *refn, int len);
ERTS_GLB_INLINE Eterm erts_get_pid_of_ref(Eterm ref);
#define ERTS_REF1_MAGIC_MARKER_BIT_NO__ \
@@ -256,11 +254,24 @@ erts_magic_ref_lookup_bin(Uint32 ref[ERTS_REF_NUMBERS])
* from the outside world...
*/
ERTS_GLB_INLINE Eterm
-erts_pid_ref_lookup(Uint32 *refn)
+erts_pid_ref_lookup(Uint32 *refn, int len)
{
+ Eterm pid;
+ if (len != ERTS_PID_REF_NUMBERS)
+ return am_undefined;
if (!erts_is_pid_ref_numbers(refn))
- return THE_NON_VALUE;
- return erts_pid_ref_lookup__(refn);
+ return am_undefined;
+
+ pid = (((Eterm) refn[3])
+#ifdef ARCH_64
+ | (((Eterm) refn[4]) << 32)
+#endif
+ );
+
+ if (!is_internal_pid(pid))
+ return THE_NON_VALUE; /* We got garbage; we have not created this... */
+
+ return pid;
}
ERTS_GLB_INLINE Eterm erts_get_pid_of_ref(Eterm ref)