aboutsummaryrefslogtreecommitdiff
path: root/src/universe.h
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2022-02-07 08:56:39 +0100
committerBenoit Germain <bnt.germain@gmail.com>2022-02-07 08:56:39 +0100
commit621fb024b5f887ef9e81e2f28bf087386f5300e1 (patch)
tree3ed681e2db07a0516904b2cda4e7144c714d19e0 /src/universe.h
parent00c84df3adc0b295ef20bc35bc8df9632e3b93e7 (diff)
downloadlanes-621fb024b5f887ef9e81e2f28bf087386f5300e1.tar.gz
lanes-621fb024b5f887ef9e81e2f28bf087386f5300e1.tar.bz2
lanes-621fb024b5f887ef9e81e2f28bf087386f5300e1.zip
Changed all indentations to all whitespaces
Tabs mess up alignment of stack contents comments, so I'm done with them.
Diffstat (limited to '')
-rw-r--r--src/universe.h64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/universe.h b/src/universe.h
index 0ef5a93..248a117 100644
--- a/src/universe.h
+++ b/src/universe.h
@@ -27,16 +27,16 @@ typedef struct s_Lane Lane;
27// everything we need to provide to lua_newstate() 27// everything we need to provide to lua_newstate()
28struct AllocatorDefinition_s 28struct AllocatorDefinition_s
29{ 29{
30 lua_Alloc allocF; 30 lua_Alloc allocF;
31 void* allocUD; 31 void* allocUD;
32}; 32};
33typedef struct AllocatorDefinition_s AllocatorDefinition; 33typedef struct AllocatorDefinition_s AllocatorDefinition;
34 34
35// mutex-protected allocator for use with Lua states that share a non-threadsafe allocator 35// mutex-protected allocator for use with Lua states that share a non-threadsafe allocator
36struct ProtectedAllocator_s 36struct ProtectedAllocator_s
37{ 37{
38 AllocatorDefinition definition; 38 AllocatorDefinition definition;
39 MUTEX_T lock; 39 MUTEX_T lock;
40}; 40};
41typedef struct ProtectedAllocator_s ProtectedAllocator; 41typedef struct ProtectedAllocator_s ProtectedAllocator;
42 42
@@ -47,51 +47,51 @@ typedef struct ProtectedAllocator_s ProtectedAllocator;
47// don't forget to initialize all members in LG_configure() 47// don't forget to initialize all members in LG_configure()
48struct s_Universe 48struct s_Universe
49{ 49{
50 // for verbose errors 50 // for verbose errors
51 bool_t verboseErrors; 51 bool_t verboseErrors;
52 52
53 bool_t demoteFullUserdata; 53 bool_t demoteFullUserdata;
54 54
55 // before a state is created, this function will be called to obtain the allocator 55 // before a state is created, this function will be called to obtain the allocator
56 lua_CFunction provide_allocator; 56 lua_CFunction provide_allocator;
57 57
58 // after a state is created, this function will be called right after the bases libraries are loaded 58 // after a state is created, this function will be called right after the bases libraries are loaded
59 lua_CFunction on_state_create_func; 59 lua_CFunction on_state_create_func;
60 60
61 // Initialized and used only if allocator="protected" is found in the configuration settings 61 // Initialized and used only if allocator="protected" is found in the configuration settings
62 // contains a mutex and the original allocator definition 62 // contains a mutex and the original allocator definition
63 ProtectedAllocator protected_allocator; 63 ProtectedAllocator protected_allocator;
64 64
65 Keepers* keepers; 65 Keepers* keepers;
66 66
67 // Initialized by 'init_once_LOCKED()': the deep userdata Linda object 67 // Initialized by 'init_once_LOCKED()': the deep userdata Linda object
68 // used for timers (each lane will get a proxy to this) 68 // used for timers (each lane will get a proxy to this)
69 volatile DeepPrelude* timer_deep; // = NULL 69 volatile DeepPrelude* timer_deep; // = NULL
70 70
71#if HAVE_LANE_TRACKING 71#if HAVE_LANE_TRACKING
72 MUTEX_T tracking_cs; 72 MUTEX_T tracking_cs;
73 Lane* volatile tracking_first; // will change to TRACKING_END if we want to activate tracking 73 Lane* volatile tracking_first; // will change to TRACKING_END if we want to activate tracking
74#endif // HAVE_LANE_TRACKING 74#endif // HAVE_LANE_TRACKING
75 75
76 MUTEX_T selfdestruct_cs; 76 MUTEX_T selfdestruct_cs;
77 77
78 // require() serialization 78 // require() serialization
79 MUTEX_T require_cs; 79 MUTEX_T require_cs;
80 80
81 // Lock for reference counter inc/dec locks (to be initialized by outside code) TODO: get rid of this and use atomics instead! 81 // Lock for reference counter inc/dec locks (to be initialized by outside code) TODO: get rid of this and use atomics instead!
82 MUTEX_T deep_lock; 82 MUTEX_T deep_lock;
83 MUTEX_T mtid_lock; 83 MUTEX_T mtid_lock;
84 84
85 lua_Integer last_mt_id; 85 lua_Integer last_mt_id;
86 86
87#if USE_DEBUG_SPEW 87#if USE_DEBUG_SPEW
88 int debugspew_indent_depth; 88 int debugspew_indent_depth;
89#endif // USE_DEBUG_SPEW 89#endif // USE_DEBUG_SPEW
90 90
91 Lane* volatile selfdestruct_first; 91 Lane* volatile selfdestruct_first;
92 // After a lane has removed itself from the chain, it still performs some processing. 92 // After a lane has removed itself from the chain, it still performs some processing.
93 // The terminal desinit sequence should wait for all such processing to terminate before force-killing threads 93 // The terminal desinit sequence should wait for all such processing to terminate before force-killing threads
94 int volatile selfdestructing_count; 94 int volatile selfdestructing_count;
95}; 95};
96typedef struct s_Universe Universe; 96typedef struct s_Universe Universe;
97 97