bfjit icon indicating copy to clipboard operation
bfjit copied to clipboard

Using SIGSEGV to detect and resize BF memory appropriately

Open Mozartenhimer opened this issue 1 year ago • 0 comments

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.

Mozartenhimer avatar Apr 04 '24 23:04 Mozartenhimer