Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rossdylan
Copy link
Contributor

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.

src/pool.h Outdated

#ifdef GIT_DEBUG_POOL
#include "vector.h"
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ifdef isn't necessary.

@carlosmn
Copy link
Member

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

@rossdylan
Copy link
Contributor Author

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

src/pool.h Outdated
/*
* Misc utilities
*/
#ifndef _DEBUG_POOL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be GIT_DEBUG_POOL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, looks like I typo'd that.

@ethomson
Copy link
Member

Thanks for tackling this!

ethomson pushed a commit that referenced this pull request Feb 28, 2016
Add a new build flag to disable the pool allocator
@ethomson ethomson merged commit 6cc4bac into libgit2:master Feb 28, 2016
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.

3 participants