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

Add a new build flag to disable the pool allocator #3577

Merged
merged 3 commits into from Feb 28, 2016

Conversation

Projects
None yet
3 participants
@rossdylan
Contributor

rossdylan commented Jan 14, 2016

Calls to git_pool__malloc are proxied directly to git__malloc. Allocations are tracked using a git_vector and freed when git_pool_clear is called. I am currently using ifdef/ifndef to enable and disable the debug code. I also enable/disable a couple of the pool test cases which won't work when debug is turned on.

Add a new build flag to disable the pool allocator and pass all git_p…
…ool_malloc calls straight to git__malloc
Show outdated Hide outdated src/pool.h
@@ -9,8 +9,13 @@
#include "common.h"
#ifdef GIT_DEBUG_POOL
#include "vector.h"
#endif

This comment has been minimized.

@carlosmn

carlosmn Feb 19, 2016

Member

This ifdef isn't necessary.

@carlosmn

carlosmn Feb 19, 2016

Member

This ifdef isn't necessary.

@carlosmn

This comment has been minimized.

Show comment
Hide comment
@carlosmn

carlosmn Feb 19, 2016

Member

Thanks, this looks pretty straightforward. Other than the ifdef'd include, I think we could include this.

Member

carlosmn commented Feb 19, 2016

Thanks, this looks pretty straightforward. Other than the ifdef'd include, I think we could include this.

@rossdylan

This comment has been minimized.

Show comment
Hide comment
@rossdylan

rossdylan Feb 19, 2016

Contributor

awesome, I just pushed a second commit which removes the ifdef.

Contributor

rossdylan commented Feb 19, 2016

awesome, I just pushed a second commit which removes the ifdef.

Show outdated Hide outdated src/pool.h
@@ -98,7 +124,9 @@ extern char *git_pool_strcat(git_pool *pool, const char *a, const char *b);
/*
* Misc utilities
*/
#ifndef _DEBUG_POOL

This comment has been minimized.

@ethomson

ethomson Feb 26, 2016

Member

Should this be GIT_DEBUG_POOL?

@ethomson

ethomson Feb 26, 2016

Member

Should this be GIT_DEBUG_POOL?

This comment has been minimized.

@rossdylan

rossdylan Feb 26, 2016

Contributor

yep, looks like I typo'd that.

@rossdylan

rossdylan Feb 26, 2016

Contributor

yep, looks like I typo'd that.

@ethomson

This comment has been minimized.

Show comment
Hide comment
@ethomson

ethomson Feb 28, 2016

Member

Thanks for tackling this!

Member

ethomson commented Feb 28, 2016

Thanks for tackling this!

ethomson pushed a commit that referenced this pull request Feb 28, 2016

Edward Thomson
Merge pull request #3577 from rossdylan/rossdylan/pooldebug
Add a new build flag to disable the pool allocator

@ethomson ethomson merged commit 6cc4bac into libgit2:master Feb 28, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment