Closed mcfriend99 closed 3 years ago
I don't have code for this lying around, but it should be possible to make it work. Things you will need to keep in mind:
NULL
.NULL
. Also make sure to walk those arrays and mark all of their entries. Don't mark unused slots in the array since they may have stale pointers to freed objects.It's really useful if you haven't already to learn to step through code in a debugger so you can see exactly where it is crashing and what is in memory when that happens. llbd is fine, though I personally prefer IDE debuggers like XCode. You can solve this, but it may take some work to iron out all the bugs. Dealing with garbage collectors and dynamic memory management is tricky for all us. I ran into many many bugs and crashes when I was writing this. :)
Hi @munificent,
I am trying to raise the
Local
s andUpValue
s limit toUINT16_MAX + 1
.I have tried:
UINT16_MAX + 1
toLocal*
andUpValue*
in the initCompiler method using bothmalloc
andcalloc
,locals[UINT16_COUNT]
andupvalues[UINT16_COUNT]
Every approach gives the same problem. THEY CAN'T RUN CLOSURES.
Closures always throw a
SEGMENTATION_ERROR
and running them though thelldb
shows that they all exit duringmarkCompilerRoots
's call tomarkObject
.Please what is the best approach to achieve a
UINT16_MAX + 1
like Java orundefined
(technically 2^32) like python limit for locals and upvalues (I don't believe either has a concept of upvalues).Do you have a sample code you can share??
Regards.