From 3229fa753cef10eda963247eaedec1d6ed9de9e4 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Tue, 18 Jun 2024 10:06:53 +0200 Subject: Moved AllocatorDefinition in a lanes namespace --- docs/index.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/index.html b/docs/index.html index fe92565..4a9fc35 100644 --- a/docs/index.html +++ b/docs/index.html @@ -289,11 +289,17 @@ If nil, Lua states are created with lua_newstate() and reuse the allocator from the master state.
If "protected", The default allocator obtained from lua_getallocf() in the master state is wrapped inside a critical section and used in all newly created states.
- If a function, this function is called prior to creating the state, with a single string argument, either "keeper" or "lane". It should return a full userdata containing the following structure: + If a function, this function is called prior to creating the state, with a single string argument, either "keeper" or "lane". It should return a full userdata created as follows:
-
	struct { uintptr_t version { AllocatorDefinition::kAllocatorVersion }; lua_Alloc allocF; void* allocUD; }
+
+	static constexpr lua_CFunction _provideAllocator = +[](lua_State* const L_) {
+		lanes::AllocatorDefinition* const _def{ new (L_) lanes::AllocatorDefinition{} };
+		// populate _def->allocF and _def->allocUD here
+		return 1;
+	};
+							
-- cgit v1.2.3-55-g6feb