Skip to content

Commit 2b19c00

Browse files
committed
Add popcorn ets
1 parent c8d0473 commit 2b19c00

File tree

9 files changed

+1723
-0
lines changed

9 files changed

+1723
-0
lines changed

src/libAtomVM/context.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ void context_destroy(Context *ctx)
289289
free(ctx->platform_data);
290290

291291
ets_delete_owned_tables(&ctx->global->ets, ctx->process_id, ctx->global);
292+
popcorn_ets_delete_owned_tables(&ctx->global->popcorn_ets, ctx->process_id, ctx->global);
292293

293294
free(ctx);
294295
}

src/libAtomVM/globalcontext.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ GlobalContext *globalcontext_new(void)
8484
synclist_init(&glb->select_events);
8585

8686
ets_init(&glb->ets);
87+
popcorn_ets_init(&glb->popcorn_ets);
8788

8889
glb->last_process_id = 0;
8990

@@ -230,6 +231,7 @@ COLD_FUNC void globalcontext_destroy(GlobalContext *glb)
230231
synclist_destroy(&glb->select_events);
231232

232233
ets_destroy(&glb->ets, glb);
234+
popcorn_ets_destroy(&glb->popcorn_ets, glb);
233235

234236
// Destroy refc binaries including resources
235237
// (this list should be empty if resources were properly refcounted)

src/libAtomVM/globalcontext.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
#include <stdint.h>
3232

33+
#include "popcorn/popcorn_ets.h"
34+
3335
#include "atom.h"
3436
#include "atom_table.h"
3537
#include "erl_nif.h"
@@ -121,6 +123,7 @@ struct GlobalContext
121123
struct SyncList select_events;
122124

123125
struct Ets ets;
126+
struct PopcornEts popcorn_ets;
124127

125128
int32_t last_process_id;
126129

0 commit comments

Comments
 (0)