diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-03-12 23:09:16 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-03-14 23:52:32 +0200 |
commit | 6b2a19418cb08e7bccefc2362f290a67555594a0 (patch) | |
tree | 44e666e45a50a59a444886b70c25c7c954d0ba4f /include/git2/object.h | |
parent | 005718280712634486a097427212e652b0e29f36 (diff) | |
download | libgit2-6b2a19418cb08e7bccefc2362f290a67555594a0.tar.gz |
Fix the retarded object interdependency system
It's no longer retarded. All object interdependencies are stored as OIDs
instead of actual objects. This should be hundreds of times faster,
specially on big repositories. Heck, who knows, maye it doesn't even
segfault -- wouldn't that be awesome?
What has changed on the API?
`git_commit_parent`, `git_commit_tree`, `git_tag_target` now return
their values through a pointer-to-pointer, and have an error code.
`git_commit_set_tree` and `git_tag_set_target` now return an error
code and may fail.
`git_repository_free__no_gc` has been deprecated because it's
stupid. Since there are no longer any interdependencies between
objects, we don't need internal reference counting, and GC
never fails or double-free's pointers.
`git_object_close` now does a very sane thing: marks an object
as unused. Closed objects will be eventually free'd from the
object cache based on LRU. Please use `git_object_close` from
the garbage collector `destroy` method on your bindings. It's
100% safe.
`git_repository_gc` is a new method that forces a garbage collector
pass through the repo, to free as many LRU objects as possible.
This is useful if we are running out of memory.
Diffstat (limited to 'include/git2/object.h')
-rw-r--r-- | include/git2/object.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/git2/object.h b/include/git2/object.h index af0f014e3..748386f69 100644 --- a/include/git2/object.h +++ b/include/git2/object.h @@ -131,10 +131,10 @@ GIT_EXTERN(git_repository *) git_object_owner(const git_object *obj); * Close an open object * * This method instructs the library to close an existing - * object; note that git_objects are owned by the repository - * and are reference counted, so the object may or may not be - * freed after this library call, depending on whether any other - * objects still depend on it. + * object; note that git_objects are owned and cached by the repository + * so the object may or may not be freed after this library call, + * depending on how agressive is the caching mechanism used + * by the repository. * * IMPORTANT: * It is *not* necessary to call this method when you stop using |