aboutsummaryrefslogtreecommitdiff
path: root/src/linda.c
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2022-03-09 14:11:21 +0100
committerBenoit Germain <bnt.germain@gmail.com>2022-03-09 14:11:21 +0100
commit49ef9d50d475921aab0c50b13b857f8cb990fcc0 (patch)
tree0b5e4deefd63481e99557dd326352a4bb8cb5dc0 /src/linda.c
parentfe44f7e83fc0b3264533caaa3085938d78c3750b (diff)
downloadlanes-49ef9d50d475921aab0c50b13b857f8cb990fcc0.tar.gz
lanes-49ef9d50d475921aab0c50b13b857f8cb990fcc0.tar.bz2
lanes-49ef9d50d475921aab0c50b13b857f8cb990fcc0.zip
moonjit support
Diffstat (limited to 'src/linda.c')
-rw-r--r--src/linda.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/linda.c b/src/linda.c
index 42cda51..637f909 100644
--- a/src/linda.c
+++ b/src/linda.c
@@ -795,16 +795,16 @@ static void* linda_id( lua_State* L, DeepOp op_)
795 * just don't use L's allocF because we don't know which state will get the honor of GCing the linda 795 * just don't use L's allocF because we don't know which state will get the honor of GCing the linda
796 */ 796 */
797 // don't hijack the state allocator when running LuaJIT because it looks like LuaJIT does not expect it and might invalidate the memory unexpectedly 797 // don't hijack the state allocator when running LuaJIT because it looks like LuaJIT does not expect it and might invalidate the memory unexpectedly
798#if USE_LUA_STATE_ALLOCATOR 798#if USE_LUA_STATE_ALLOCATOR()
799 { 799 {
800 Universe* const U = universe_get(L); 800 Universe* const U = universe_get(L);
801 AllocatorDefinition* const allocD = &U->protected_allocator.definition; 801 AllocatorDefinition* const allocD = &U->protected_allocator.definition;
802 802
803 s = (struct s_Linda*)allocD->allocF(allocD->allocUD, NULL, 0, sizeof(struct s_Linda) + name_len); // terminating 0 is already included 803 s = (struct s_Linda*)allocD->allocF(allocD->allocUD, NULL, 0, sizeof(struct s_Linda) + name_len); // terminating 0 is already included
804 } 804 }
805#else // USE_LUA_STATE_ALLOCATOR 805#else // USE_LUA_STATE_ALLOCATOR()
806 s = (struct s_Linda*)malloc(sizeof(struct s_Linda) + name_len); // terminating 0 is already included 806 s = (struct s_Linda*)malloc(sizeof(struct s_Linda) + name_len); // terminating 0 is already included
807#endif // USE_LUA_STATE_ALLOCATOR 807#endif // USE_LUA_STATE_ALLOCATOR()
808 if( s) 808 if( s)
809 { 809 {
810 s->prelude.magic.value = DEEP_VERSION.value; 810 s->prelude.magic.value = DEEP_VERSION.value;
@@ -838,16 +838,16 @@ static void* linda_id( lua_State* L, DeepOp op_)
838 SIGNAL_FREE( &linda->read_happened); 838 SIGNAL_FREE( &linda->read_happened);
839 SIGNAL_FREE( &linda->write_happened); 839 SIGNAL_FREE( &linda->write_happened);
840 // don't hijack the state allocator when running LuaJIT because it looks like LuaJIT does not expect it and might invalidate the memory unexpectedly 840 // don't hijack the state allocator when running LuaJIT because it looks like LuaJIT does not expect it and might invalidate the memory unexpectedly
841#if USE_LUA_STATE_ALLOCATOR 841#if USE_LUA_STATE_ALLOCATOR()
842 { 842 {
843 Universe* const U = universe_get(L); 843 Universe* const U = universe_get(L);
844 AllocatorDefinition* const allocD = &U->protected_allocator.definition; 844 AllocatorDefinition* const allocD = &U->protected_allocator.definition;
845 845
846 allocD->allocF(allocD->allocUD, linda, sizeof(struct s_Linda) + strlen(linda->name), 0); 846 allocD->allocF(allocD->allocUD, linda, sizeof(struct s_Linda) + strlen(linda->name), 0);
847 } 847 }
848#else // USE_LUA_STATE_ALLOCATOR 848#else // USE_LUA_STATE_ALLOCATOR()
849 free(linda); 849 free(linda);
850#endif // USE_LUA_STATE_ALLOCATOR 850#endif // USE_LUA_STATE_ALLOCATOR()
851 return NULL; 851 return NULL;
852 } 852 }
853 853