aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_load.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/hipe/hipe_load.c')
-rw-r--r--erts/emulator/hipe/hipe_load.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/erts/emulator/hipe/hipe_load.c b/erts/emulator/hipe/hipe_load.c
index 48f0cab293..6261857d8f 100644
--- a/erts/emulator/hipe/hipe_load.c
+++ b/erts/emulator/hipe/hipe_load.c
@@ -32,13 +32,8 @@
#include "erl_binary.h"
#include "hipe_load.h"
-/*
- * This destructor function can safely be called multiple times.
- */
-static void
-hipe_loader_state_dtor(Binary* magic)
+void hipe_free_loader_state(HipeLoaderState *stp)
{
- HipeLoaderState* stp = ERTS_MAGIC_BIN_DATA(magic);
if (stp->module == NIL) return;
erts_fprintf(stderr, "Destroying HiPE loader state for module %T\n",
@@ -64,6 +59,16 @@ hipe_loader_state_dtor(Binary* magic)
*/
}
+static void
+hipe_loader_state_dtor(Binary* magic)
+{
+ HipeLoaderState* stp = ERTS_MAGIC_BIN_DATA(magic);
+
+ ASSERT(ERTS_MAGIC_BIN_DESTRUCTOR(magic) == hipe_loader_state_dtor);
+
+ hipe_free_loader_state(stp);
+}
+
Binary *hipe_alloc_loader_state(Eterm module)
{
HipeLoaderState *stp;
@@ -90,15 +95,6 @@ Binary *hipe_alloc_loader_state(Eterm module)
return magic;
}
-void hipe_free_loader_state(Binary *magic)
-{
- if (ERTS_MAGIC_BIN_DESTRUCTOR(magic) != hipe_loader_state_dtor)
- return;
-
- /* Why does BEAM do a refc_dec here? What is holding that reference? */
- hipe_loader_state_dtor(magic);
-}
-
HipeLoaderState *
hipe_get_loader_state(Binary *magic)
{