mlprof

Stephen Weeks MLton@sourcelight.com
Wed, 21 Mar 2001 19:06:06 -0800 (PST)


> My suspicion is that it has something to do with the use of the stack pointer.
> Ah, did you put in the code we talked about to set up an alternate signal
> stack?

Yes.  The following code runs at program startup.

static void initSignalStack(GC_state s) {
        static stack_t altstack;
	size_t ss_size = roundPage(SIGSTKSZ);
	size_t psize = getpagesize();

	void *ss_sp = ssmmap(2 * ss_size, psize, psize);
	altstack.ss_sp = ss_sp + ss_size;
	altstack.ss_size = ss_size;
	altstack.ss_flags = 0;

	sigaltstack(&altstack, NULL);
}