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

The pool allocator should support being deactivated for debug #3543

Closed
carlosmn opened this Issue Dec 10, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@carlosmn
Member

carlosmn commented Dec 10, 2015

The pool allocator is great for performance when we have a bunch of small allocations. But since we're allocating much more than we want to use at a time, it doesn't let valgrind or similar tools see what we're actually doing.

We should have a compile-time option to disable allocating the pool and passing each request to git__malloc() so don't work around the tools that are trying to tell us about bad memory accesses.

Instead of pooling allocations, we'd have to keep track of the allocations so we can free them in git_pool_clear() so we don't end up leaking everything.

@rossdylan

This comment has been minimized.

Show comment
Hide comment
@rossdylan

rossdylan Jan 12, 2016

Contributor

I've started working on this and I had a question about coding conventions. For debug code like this is it preferred to use ifdef's to enable/disable it, if not what is the preferred method?

Contributor

rossdylan commented Jan 12, 2016

I've started working on this and I had a question about coding conventions. For debug code like this is it preferred to use ifdef's to enable/disable it, if not what is the preferred method?

@ethomson

This comment has been minimized.

Show comment
Hide comment
@ethomson

ethomson Feb 28, 2016

Member

Fixed via #3577

Member

ethomson commented Feb 28, 2016

Fixed via #3577

@ethomson ethomson closed this Feb 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment