Skip to content
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

Consider replacing alloca with malloc for portability #121

Open
khallock opened this issue Dec 21, 2019 · 0 comments
Open

Consider replacing alloca with malloc for portability #121

khallock opened this issue Dec 21, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@khallock
Copy link
Contributor

Also, a note to myself and other NCL developers for future reference - I think it might be preferable to avoid using platform-dependent #ifdefs inside these source files and instead replace any alloca calls with malloc/free as needed to ensure portability.

From my comment on PR #119

As of #119 being merged, we now have #ifdef __FreeBSD__ in the files

ni/src/ncl/FileSupport.c
ni/src/ncl/NclAdvancedFile.h

I think it may be worth removing #include <alloca.h> from those files and then replacing alloca with malloc/free in

ni/src/ncl/FileSupport.c
ni/src/ncl/NclAdvancedFile.c

in order to avoid using a platform-specific #ifdef.

@pilotchute pilotchute added the enhancement New feature or request label May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants