[RFC]: use POOL_ALLOC
and POOL_FREE
for objects with known lifetime in future.c
#807
Labels
POOL_ALLOC
and POOL_FREE
for objects with known lifetime in future.c
#807
The use of
encore_alloc
inactor_list *entry = encore_alloc(cctx, sizeof *entry);
will ask for some memory from the current actor heap, and this memory will be managed by the GC protocol. However, the instant when this memory become collectable is statically know, the loop of iteratingawaited_actors
, in this case.In other places of the runtime,
POOL_ALLOC
andPOOL_FREE
are used for objects with known lifetime,messageq
andmpmcq
are two examples. Therefore, I propose to replace all occurrences ofencore_alloc
infuture.c
withPOOL_ALLOC
&POOL_FREE
infuture.c
.The proposed change will simply the code, and reduce the floating garbage, for we don't need to wait for a GC cycle to reclaim the memory.
The text was updated successfully, but these errors were encountered: