Hi David, as far as I can see the code has already been patched. This is from the tip version of platforms/unix/vm/sqUnixSpurMemory.c,
commit b0558b4
Author: Eliot Miranda eliot.miranda@gmail.com
Date: Tue Dec 13 17:04:50 2022 -0800

Change the type of sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto to get
sqMacV2Memory.c to compile on 32-bit MacOS. It should have taken usqInts in the
first place. Implement allocateJITMemory for sqMacV2Memory.c/V3 macOS.

usqInt
sqAllocateMemory(usqInt minHeapSize, usqInt desiredHeapSize)
{
char *hint, *address, *alloc;
unsigned long alignment;
sqInt allocBytes;

#if !COGVM
if (pageSize) {
fprintf(stderr, "sqAllocateMemory: already called\n");
exit(1);
}
pageSize = getpagesize();
pageMask = ~(pageSize - 1);

hint = sbrk(0);

#else
assert(pageSize != 0 && pageMask != 0);
hint = endOfJITZone;
#endif

alignment = max(pageSize,1024*1024);
address = (char *)(((usqInt)hint + alignment - 1) & ~(alignment - 1));

alloc = sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto
            (roundUpToPage(desiredHeapSize), address, &allocBytes);
if (!alloc) {
    fprintf(stderr, "sqAllocateMemory: initial alloc failed!\n");
    exit(errno);
}
return (usqInt)alloc;

}


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <OpenSmalltalk/opensmalltalk-vm/issues/665/1908758669@github.com>