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

store block size in when using malloc and nogc #4002

Merged
merged 3 commits into from Apr 26, 2016

Conversation

arnetheduck
Copy link
Contributor

this allows for a correct implementation of realloc, which is needed as
code using it assumes new values will be zeroed out / nil

this allows for a correct implementation of realloc, which is needed as
code using it assumes new values will be zeroed out / nil
@Araq
Copy link
Member

Araq commented Mar 25, 2016

That means 'dealloc' is not an alias for 'free' anymore... What's the point? What IS the point of useMalloc? Let's deprecate it, it's crap.

@arnetheduck
Copy link
Contributor Author

oh, I found it useful while developing nlvm, to avoid lots of funny memory management code turning up everywhere.. it's nice for debugging as well, as it works with valgrind and friends. nogc mode in general is an interesting tradeoff - for short-running processes it actually makes a lot of sense assuming memory is cheap and plentiful.

I'd think that if someone wants to free c memory (ie stuff they got from c libraries), they should call c_free? that seems to be the way with the other low-level c imports..

@Araq
Copy link
Member

Araq commented Mar 25, 2016

Document it properly then. news.txt and nimc.txt.

@arnetheduck
Copy link
Contributor Author

done

@Araq Araq merged commit ae4142b into nim-lang:devel Apr 26, 2016
@arnetheduck arnetheduck deleted the malloc-store-size branch November 17, 2016 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants