GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
The LLJS memory allocator does not support automatic garbage collection currently. Would be nice to be able to switch GC on/off when compiling. If the GC is turned on, the memory allocator would fall back to not using an ArrayBuffer at all - thus running like regular js. Alternatively could even try adding a Boehm GC to LLJS :)
Part of the reason to use something like LLJS is to avoid automatic memory management, but someone could certainly implement a Boehm GC however it can get quite complicated since pointers can leak into plain JS objects. The other researchy problem is what to do with dead JS objects that hang on to malloc allocated things. In JS, there is no way to get notified of or detect that an object is about to be garbage collected, so there is no opportunity to free the malloc'ed memory.
How about something like Automatic Reference Counting instead?