-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Remove the buffer argument from loc_getenv #58
base: master
Are you sure you want to change the base?
Conversation
@j256 we are porting dmalloc to RTOS environment, it's critical to reduce the stack consumption as much as possbile. |
Thanks for this. Can you instead make the change where it is used. So revert the changes to |
Since the buffer is only needed for cygwin, it isn't good to expose the buffer allocation outside loc_getenv to pollute other platform. I I add __thread to make buf become per thread, could you take a look? |
Don't think of portability as polluting. The |
__thread is only used in cygwin, and I test that cygwin's clang and gcc both support __thread. So the portability isn't problem here. |
3c7a480
to
633c9aa
Compare
@j256 I fix the problem by macro to avoid __thread, please review again. |
@j256 could you take time to review my patch? |
1.Avoid to allocate the big buffer on the caller stack 2.The temporary buffer is only used on cygwin Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I8bd325624a2f9b8cd1f791f0c07fc76d02158e1d
1.Avoid to allocate the big buffer on the caller stack
2.The temporary buffer is only used on cygwin