Skip to content

Fix init - #230

Merged
skx merged 2 commits into
mainfrom
fix-init
Jul 29, 2026
Merged

Fix init#230
skx merged 2 commits into
mainfrom
fix-init

Conversation

@skx

@skx skx commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Fix the frame size used for global init code.

We previously reserved 256 bytes of stack/frame space for functions, and then switched to calculating the real size because that was more efficient (and correct).

Similar story here, we were blindly reserving a fixed size for global inits, but that failed when we ran code like this

        (defun fun (list (list "steve" "blah")
                         (list 1 2 (/ 1.0 3))
                         ; ..
            ))

That would cause a segfault on startup, as the updated examples/globals.lisp test did, when I was experimenting with drawing graphics.

Now the tests pass and no more segfault. I also switched to auto-calling the non-GC version of the (list .. primitive. Not yet sure if that is a mistake.

skx added 2 commits July 29, 2026 20:33
We previously reserved 256 bytes of stack/frame space for
functions, and then switched to calculating the real size
because that was more efficient (and correct).

Similar story here, we were blindly reserving a fixed size
for global inits, but that failed when we ran code like this

        (defun fun (list (list "steve" "blah")
                         (list 1 2 (/ 1.0 3))
                         ; ..
            ))

That would cause a segfault on startup.
@skx
skx merged commit 99d5c7e into main Jul 29, 2026
1 check passed
@skx
skx deleted the fix-init branch July 29, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant