Apparently, SDL on OSX does employ Objective-C.
Unfortunate. I guess the first attempt will be getting something to work at all, using mixed components from your back yard, then. :-)
That means, at the very least, you'll need to wrap all of your SDL code with an NSAutoreleasePool. Now, depending on how much Objective-C is being used, you'll need to release the pool every so often, otherwise, you'll tie up a huge chunk of memory for unreleased objects.
Okay. I'm sure experience will show once I'm far into it enough to see what happens when it no longer segfaults.
Perhaps you'd like to try it along with Public.ObjectiveC, which should at the very least, give you an easy mechanism for freeing the pool from within Pike code.
I think I'm past the initial hurdle of finding the above (after a few failed attempts with pike -x monger :-) --
wget http://hww3.riverweb.com/dist/Public_ObjectiveC_Tiger.tar.gz tar zxf Public_ObjectiveC_Tiger.tar.gz mv Public.pmod ~pike77/lib/modules/
Then I'm stuck. I assume I should do something clever first in the init() and last in the exit() of GLUE.pmod/Drivers.pmod/SDL.pike, likely involving Public.ObjectiveC.Cocoa.NSAutoreleasePool, but I'm not quite sure what nor how; I have used ObjectiveC neither in glued nor raw form in my day yet, so I am kind of lost. :-)
Taking further wild shots in the dark, does the tweaking hinted above mean the occasional Public.ObjectiveC.purge_autorelease_pool() call? (Well, maybe I'm better off not applying any wild guesswork here. :-)
Are there any handy #ifdef __DARWIN__ or similar I might want to wrap code doing these things in, by the way, and what would they be named? Alternate interesting question: how do I list all #defines defined in a pike level compile unit?