bfjit
bfjit copied to clipboard
Using SIGSEGV to detect and resize BF memory appropriately
I implemented a dynamic memory scheme using OS memory management functionality. I set the permissions of the pages surrounding the bf program's memory to PROT_NONE, so if the bf program accesses memory outside of it's bounds, the segfault handler resizes the memory and edits the data pointer register to the point to the correct offset in the newly allocated memory.
I thought this was a hilarious concept, but it is also free bounds checking. I fully support you ripping this off and re-implementing, preferably on stream.
Enjoy Mr. Tsoding.