diff options
Diffstat (limited to 'src/linda.cpp')
-rw-r--r-- | src/linda.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/linda.cpp b/src/linda.cpp index a6025ce..f2e39a8 100644 --- a/src/linda.cpp +++ b/src/linda.cpp | |||
@@ -791,8 +791,8 @@ static void* linda_id( lua_State* L, DeepOp op_) | |||
791 | * One can use any memory allocation scheme. | 791 | * One can use any memory allocation scheme. |
792 | * just don't use L's allocF because we don't know which state will get the honor of GCing the linda | 792 | * just don't use L's allocF because we don't know which state will get the honor of GCing the linda |
793 | */ | 793 | */ |
794 | Universe* const U = universe_get(L); | ||
794 | { | 795 | { |
795 | Universe* const U = universe_get(L); | ||
796 | AllocatorDefinition* const allocD = &U->internal_allocator; | 796 | AllocatorDefinition* const allocD = &U->internal_allocator; |
797 | s = (struct s_Linda*) allocD->allocF(allocD->allocUD, nullptr, 0, sizeof(struct s_Linda) + name_len); // terminating 0 is already included | 797 | s = (struct s_Linda*) allocD->allocF(allocD->allocUD, nullptr, 0, sizeof(struct s_Linda) + name_len); // terminating 0 is already included |
798 | } | 798 | } |
@@ -801,7 +801,7 @@ static void* linda_id( lua_State* L, DeepOp op_) | |||
801 | s->prelude.DeepPrelude::DeepPrelude(); | 801 | s->prelude.DeepPrelude::DeepPrelude(); |
802 | SIGNAL_INIT( &s->read_happened); | 802 | SIGNAL_INIT( &s->read_happened); |
803 | SIGNAL_INIT( &s->write_happened); | 803 | SIGNAL_INIT( &s->write_happened); |
804 | s->U = universe_get( L); | 804 | s->U = U; |
805 | s->simulate_cancel = CancelRequest::None; | 805 | s->simulate_cancel = CancelRequest::None; |
806 | s->group = linda_group << KEEPER_MAGIC_SHIFT; | 806 | s->group = linda_group << KEEPER_MAGIC_SHIFT; |
807 | s->name[0] = 0; | 807 | s->name[0] = 0; |
@@ -828,9 +828,9 @@ static void* linda_id( lua_State* L, DeepOp op_) | |||
828 | // There aren't any lanes waiting on these lindas, since all proxies have been gc'ed. Right? | 828 | // There aren't any lanes waiting on these lindas, since all proxies have been gc'ed. Right? |
829 | SIGNAL_FREE( &linda->read_happened); | 829 | SIGNAL_FREE( &linda->read_happened); |
830 | SIGNAL_FREE( &linda->write_happened); | 830 | SIGNAL_FREE( &linda->write_happened); |
831 | linda->prelude.DeepPrelude::~DeepPrelude(); | ||
831 | { | 832 | { |
832 | Universe* const U = universe_get(L); | 833 | AllocatorDefinition* const allocD = &linda->U->internal_allocator; |
833 | AllocatorDefinition* const allocD = &U->internal_allocator; | ||
834 | (void) allocD->allocF(allocD->allocUD, linda, sizeof(struct s_Linda) + strlen(linda->name), 0); | 834 | (void) allocD->allocF(allocD->allocUD, linda, sizeof(struct s_Linda) + strlen(linda->name), 0); |
835 | } | 835 | } |
836 | return nullptr; | 836 | return nullptr; |