aboutsummaryrefslogtreecommitdiff
path: root/src/universe.h
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2022-02-07 14:51:54 +0100
committerBenoit Germain <bnt.germain@gmail.com>2022-02-07 14:51:54 +0100
commitc913a6747c420ff12fc1f0c39df791215ad2fcfd (patch)
tree8175f6fa39e1ca22881c178a0c3cfde5f95fdeb5 /src/universe.h
parentd5c81657982e96f768f76ea6c01db536f8649284 (diff)
downloadlanes-c913a6747c420ff12fc1f0c39df791215ad2fcfd.tar.gz
lanes-c913a6747c420ff12fc1f0c39df791215ad2fcfd.tar.bz2
lanes-c913a6747c420ff12fc1f0c39df791215ad2fcfd.zip
removed explicit calls to malloc/free
Lane and linda userdata were allocated with malloc/free, preventing embedders from fully controlling memory operations. Now all internal Lanes allocations go through the master state alloc function.
Diffstat (limited to '')
-rw-r--r--src/universe.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/universe.h b/src/universe.h
index 248a117..e4c1191 100644
--- a/src/universe.h
+++ b/src/universe.h
@@ -42,7 +42,7 @@ typedef struct ProtectedAllocator_s ProtectedAllocator;
42 42
43// ################################################################################################ 43// ################################################################################################
44 44
45// everything regarding the a Lanes universe is stored in that global structure 45// everything regarding the Lanes universe is stored in that global structure
46// held as a full userdata in the master Lua state that required it for the first time 46// held as a full userdata in the master Lua state that required it for the first time
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
@@ -58,7 +58,7 @@ struct s_Universe
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 // if allocator="protected" is found in the configuration settings, a wrapper allocator will protect all allocator calls with a mutex
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