diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-12-16 15:19:01 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-12-16 15:19:01 +0000 |
| commit | a05815c8267903d12470f1e5915d04e7260ce035 (patch) | |
| tree | fd90f2902f0d1544b721a1a70901fc9ae3eb3ce7 /runtime/src | |
| parent | 83f7981dfa1c07bb841a15248a34c52203af35a1 (diff) | |
Allocate effect handlers using GC alloc
Diffstat (limited to 'runtime/src')
| -rw-r--r-- | runtime/src/effects.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/src/effects.c b/runtime/src/effects.c index 7f73130d..c69b4af8 100644 --- a/runtime/src/effects.c +++ b/runtime/src/effects.c @@ -1,9 +1,10 @@ #include "./std/unistd.h" -#include "./alloc.h" +#include "./gc.h" #include "./closures.h" #include "./effects.h" struct ShedEffectHandler { + struct ShedGcObjectHeader gc_object_header; ShedEffectTag effect_tag; struct ShedEffectHandler* parent; ShedClosurePointer methods[]; @@ -25,8 +26,10 @@ ShedEffectHandler* shed__runtime__effects_push_handler( ShedEffectTag effect_tag, ShedEffectMethodIndex method_count ) { - ShedEffectHandler* handler = shed__runtime__alloc( - sizeof(ShedEffectHandler) + sizeof(ShedClosurePointer) * method_count + ShedEffectHandler* handler = shed__runtime__gc_alloc( + sizeof(ShedEffectHandler) + sizeof(ShedClosurePointer) * method_count, + sizeof(ShedEffectTag) + sizeof(struct ShedEffectHandler*), + method_count ); handler->effect_tag = effect_tag; handler->parent = shed__runtime__current_effect_handler; |
