-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to build master branch on Mac OS due to use of malloc and memalign() #405
Comments
Just confirming this still happens on the most-recent updates:
|
Hi, thanks for the report. Unfortunately none of the devs have macs anymore, so we cannot really test. If you figure it out, I would be very happy to merge a fix :) |
Ah, just remembered, the usage of memalign is a performance optimization, so you might get away with simply using |
I got access to a mac over the weekend, and figured I'd quickly take a look ;) |
Attempting to build on Mac OS fails because we don't have
malloc.h
on the platform:I can use
![image](https://user-images.githubusercontent.com/539074/178417212-78cc96d0-288c-446d-bfcf-1c7472a2d2c0.png)
#ifndef
to avoid loadingmalloc.h
and lettingstdlib.h
do the job:...but we fail later because
memalign()
is not supported:I did try briefly to comprehend what the function is doing but I'm not familiar enough with CPU plumbing to resolve the problem.
Stackoverflow suggests the use of
posix_memalign()
. It seemed reasonable to stuff it in herestratagus/src/stratagus/util.cpp
Lines 631 to 640 in c2706c2
and my wildest guess is something like this might do the trick:
But I couldn't even begin to tell ya what goes in the first arg of the function ¯\_(ツ)_/¯
The text was updated successfully, but these errors were encountered: