aboutsummaryrefslogtreecommitdiff
path: root/src/linda.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/linda.c')
-rw-r--r--src/linda.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/linda.c b/src/linda.c
index a9c9710..21b38fe 100644
--- a/src/linda.c
+++ b/src/linda.c
@@ -758,6 +758,9 @@ LUAG_FUNC( linda_towatch)
758*/ 758*/
759static void* linda_id( lua_State* L, DeepOp op_) 759static void* linda_id( lua_State* L, DeepOp op_)
760{ 760{
761 Universe* const U = universe_get(L);
762 AllocatorDefinition* const allocD = &U->protected_allocator.definition;
763
761 switch( op_) 764 switch( op_)
762 { 765 {
763 case eDO_new: 766 case eDO_new:
@@ -794,7 +797,7 @@ static void* linda_id( lua_State* L, DeepOp op_)
794 * One can use any memory allocation scheme. 797 * One can use any memory allocation scheme.
795 * just don't use L's allocF because we don't know which state will get the honor of GCing the linda 798 * just don't use L's allocF because we don't know which state will get the honor of GCing the linda
796 */ 799 */
797 s = (struct s_Linda*) malloc( sizeof(struct s_Linda) + name_len); // terminating 0 is already included 800 s = (struct s_Linda*) allocD->allocF( allocD->allocUD, NULL, 0, sizeof(struct s_Linda) + name_len); // terminating 0 is already included
798 if( s) 801 if( s)
799 { 802 {
800 s->prelude.magic.value = DEEP_VERSION.value; 803 s->prelude.magic.value = DEEP_VERSION.value;
@@ -827,7 +830,7 @@ static void* linda_id( lua_State* L, DeepOp op_)
827 // There aren't any lanes waiting on these lindas, since all proxies have been gc'ed. Right? 830 // There aren't any lanes waiting on these lindas, since all proxies have been gc'ed. Right?
828 SIGNAL_FREE( &linda->read_happened); 831 SIGNAL_FREE( &linda->read_happened);
829 SIGNAL_FREE( &linda->write_happened); 832 SIGNAL_FREE( &linda->write_happened);
830 free( linda); 833 allocD->allocF( allocD->allocUD, linda, sizeof(struct s_Linda) + strlen(linda->name), 0);
831 return NULL; 834 return NULL;
832 } 835 }
833 836