about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lstate.c6
-rw-r--r--src/luaconf.h9
-rw-r--r--src/notes14
3 files changed, 17 insertions, 12 deletions
diff --git a/src/lstate.c b/src/lstate.c
index 4313b83..e9d8cae 100644
--- a/src/lstate.c
+++ b/src/lstate.c
@@ -24,9 +24,9 @@
 #include "ltm.h"
 
 
-#define state_size(x)	(sizeof(x) + LUAI_EXTRASPACE)
-#define fromstate(l)	(cast(lu_byte *, (l)) - LUAI_EXTRASPACE)
-#define tostate(l)   (cast(lua_State *, cast(lu_byte *, l) + LUAI_EXTRASPACE))
+#define state_size(x)	(sizeof(x))
+#define fromstate(l)	(cast(lu_byte *, (l)))
+#define tostate(l)   (cast(lua_State *, cast(lu_byte *, l)))
 
 
 /*
diff --git a/src/luaconf.h b/src/luaconf.h
index bebefc4..f24ed0e 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -665,15 +665,6 @@ union luai_Cast { double l_d; long l_l; };
 
 
 /*
-@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State
-@* (the data goes just *before* the lua_State pointer).
-** CHANGE (define) this if you really need that. This value must be
-** a multiple of the maximum alignment required for your machine.
-*/
-#define LUAI_EXTRASPACE		0
-
-
-/*
 @@ luai_userstate* allow user-specific actions on threads.
 ** CHANGE them if you defined LUAI_EXTRASPACE and need to do something
 ** extra when a thread is created/deleted/resumed/yielded.
diff --git a/src/notes b/src/notes
new file mode 100644
index 0000000..213bba7
--- /dev/null
+++ b/src/notes
@@ -0,0 +1,14 @@
+// Main thread combines a thread state and the global state
+typedef struct LG {
+  lua_State l;
+  global_State g;
+} LG;
+
+lua_State:
+  &{Value; int tt} stack, stack_last, base, top
+
+== todo stack
+delete statesize/from_state/to_state
+eradicate LUAI_EXTRASPACE
+lua_newstate
+lua_State's stack