<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/include/git2/sys/odb_backend.h, branch ethomson/object_size</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>odb: provide a free function for custom backends</title>
<updated>2019-02-23T18:42:53+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-02-23T18:42:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=459ac856d94d4a59ee47b2807aa8e4b029499582'/>
<id>459ac856d94d4a59ee47b2807aa8e4b029499582</id>
<content type='text'>
Custom backends can allocate memory when reading objects and providing
them to libgit2.  However, if an error occurs in the custom backend
after the memory has been allocated for the custom object but before
it's returned to libgit2, the custom backend has no way to free that
memory and it must be leaked.

Provide a free function that corresponds to the alloc function so that
custom backends have an opportunity to free memory before they return an
error.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Custom backends can allocate memory when reading objects and providing
them to libgit2.  However, if an error occurs in the custom backend
after the memory has been allocated for the custom object but before
it's returned to libgit2, the custom backend has no way to free that
memory and it must be leaked.

Provide a free function that corresponds to the alloc function so that
custom backends have an opportunity to free memory before they return an
error.
</pre>
</div>
</content>
</entry>
<entry>
<title>odb: rename git_odb_backend_malloc for consistency</title>
<updated>2019-02-23T18:40:43+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-02-23T18:40:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=790aae778df9bf4809e3c1e772d4d948c1cc2aa3'/>
<id>790aae778df9bf4809e3c1e772d4d948c1cc2aa3</id>
<content type='text'>
The `git_odb_backend_malloc` name is a system function that is provided
for custom ODB backends and allows them to allocate memory for an ODB
object in the read callback.  This is important so that libgit2 can
later free the memory used by an ODB object that was read from the
custom backend.

However, the name _suggests_ that it actually allocates a
`git_odb_backend`.  It does not; rename it to make it clear that it
actually allocates backend _data_.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `git_odb_backend_malloc` name is a system function that is provided
for custom ODB backends and allows them to allocate memory for an ODB
object in the read callback.  This is important so that libgit2 can
later free the memory used by an ODB object that was read from the
custom backend.

However, the name _suggests_ that it actually allocates a
`git_odb_backend`.  It does not; rename it to make it clear that it
actually allocates backend _data_.
</pre>
</div>
</content>
</entry>
<entry>
<title>indexer: use git_indexer_progress throughout</title>
<updated>2019-02-22T11:25:14+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-02-21T10:33:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=a1ef995dc03379fb1f5151b5d98d16644218c95e'/>
<id>a1ef995dc03379fb1f5151b5d98d16644218c95e</id>
<content type='text'>
Update internal usage of `git_transfer_progress` to
`git_indexer_progreses`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update internal usage of `git_transfer_progress` to
`git_indexer_progreses`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce GIT_CALLBACK macro to enforce cdecl</title>
<updated>2019-01-17T21:17:32+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-01-09T18:25:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=22d2062d954dcb88fa3dc65281d3f3d88ae87d68'/>
<id>22d2062d954dcb88fa3dc65281d3f3d88ae87d68</id>
<content type='text'>
Since we now always build the library with cdecl calling conventions,
our callbacks should be decorated as such so that users will not be able
to provide callbacks defined with other calling conventions.

The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as
appropriate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since we now always build the library with cdecl calling conventions,
our callbacks should be decorated as such so that users will not be able
to provide callbacks defined with other calling conventions.

The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as
appropriate.
</pre>
</div>
</content>
</entry>
<entry>
<title>object_type: update public API to use git_object_t</title>
<updated>2018-12-01T10:44:16+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2018-11-14T23:35:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=19faf7c5fcd24fab789d9b7a619b343c1fae7c86'/>
<id>19faf7c5fcd24fab789d9b7a619b343c1fae7c86</id>
<content type='text'>
git_object_t is the future; update the public API to use it.  This will
also ensure that we can build our tests which make use of the old API
without modification (and without compiler warnings).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git_object_t is the future; update the public API to use it.  This will
also ensure that we can build our tests which make use of the old API
without modification (and without compiler warnings).
</pre>
</div>
</content>
</entry>
<entry>
<title>odb: provide length and type with streaming read</title>
<updated>2018-02-02T00:35:49+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2017-12-17T01:12:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=97f9a5f0bca920e2ce260b17fa7cea0a2c0991ca'/>
<id>97f9a5f0bca920e2ce260b17fa7cea0a2c0991ca</id>
<content type='text'>
The streaming read functionality should provide the length and the type
of the object, like the normal read functionality does.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The streaming read functionality should provide the length and the type
of the object, like the normal read functionality does.
</pre>
</div>
</content>
</entry>
<entry>
<title>odb: freshen existing objects when writing</title>
<updated>2016-08-04T19:12:04+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-07-14T20:23:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=8f09a98e1809dcdfd9d25b8268657bac4d942e6a'/>
<id>8f09a98e1809dcdfd9d25b8268657bac4d942e6a</id>
<content type='text'>
When writing an object, we calculate its OID and see if it exists in the
object database.  If it does, we need to freshen the file that contains
it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When writing an object, we calculate its OID and see if it exists in the
object database.  If it does, we need to freshen the file that contains
it.
</pre>
</div>
</content>
</entry>
<entry>
<title>refdb and odb backends must provide `free` function</title>
<updated>2015-09-30T22:50:37+00:00</updated>
<author>
<name>Arthur Schreiber</name>
<email>schreiber.arthur@googlemail.com</email>
</author>
<published>2015-09-30T22:50:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=d3b29fb94bf1c1d0caec39b4a2c3d2061c63efec'/>
<id>d3b29fb94bf1c1d0caec39b4a2c3d2061c63efec</id>
<content type='text'>
As refdb and odb backends can be allocated by client code, libgit2
can’t know whether an alternative memory allocator was used, and thus
should not try to call `git__free` on those objects.

Instead, odb and refdb backend implementations must always provide
their own `free` functions to ensure memory gets freed correctly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As refdb and odb backends can be allocated by client code, libgit2
can’t know whether an alternative memory allocator was used, and thus
should not try to call `git__free` on those objects.

Instead, odb and refdb backend implementations must always provide
their own `free` functions to ensure memory gets freed correctly.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix @param names in doc comments</title>
<updated>2015-07-27T20:46:50+00:00</updated>
<author>
<name>Ben Chatelain</name>
<email>ben@octop.ad</email>
</author>
<published>2015-07-27T20:46:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=41808d04705644b8af566c9039a3ddcbb3257c99'/>
<id>41808d04705644b8af566c9039a3ddcbb3257c99</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>odb: make the writestream's size a git_off_t</title>
<updated>2015-05-13T07:34:20+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-05-12T11:06:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=77b339f7b6c7e167ecaf9374eb6876b498d8cb83'/>
<id>77b339f7b6c7e167ecaf9374eb6876b498d8cb83</id>
<content type='text'>
Restricting files to size_t is a silly limitation. The loose backend
writes to a file directly, so there is no issue in using 63 bits for the
size.

We still assume that the header is going to fit in 64 bytes, which does
mean quite a bit smaller files due to the run-length encoding, but it's
still a much larger size than you would want Git to handle.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Restricting files to size_t is a silly limitation. The loose backend
writes to a file directly, so there is no issue in using 63 bits for the
size.

We still assume that the header is going to fit in 64 bytes, which does
mean quite a bit smaller files due to the run-length encoding, but it's
still a much larger size than you would want Git to handle.
</pre>
</div>
</content>
</entry>
</feed>
