<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/thread-utils.c, branch v0.3.0</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>Wrap malloc and friends and report out of memory as GIT_ENOMEM</title>
<updated>2008-12-31T07:28:30+00:00</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2008-12-31T07:21:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=64a47c01426a36cdb7e598d17018d5791e54bb97'/>
<id>64a47c01426a36cdb7e598d17018d5791e54bb97</id>
<content type='text'>
We now forbid direct use of malloc, strdup or calloc within the
library and instead use wrapper functions git__malloc, etc. to
invoke the underlying library malloc and set git_errno to a no
memory error code if the allocation fails.

In the future once we have pack objects in memory we are likely
to enhance these routines with garbage collection logic to purge
cached pack data when allocations fail.  Because the size of the
function will grow somewhat large, we don't want to mark them for
inline as gcc tends to aggressively inline, creating larger than
expected executables.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We now forbid direct use of malloc, strdup or calloc within the
library and instead use wrapper functions git__malloc, etc. to
invoke the underlying library malloc and set git_errno to a no
memory error code if the allocation fails.

In the future once we have pack objects in memory we are likely
to enhance these routines with garbage collection logic to purge
cached pack data when allocations fail.  Because the size of the
function will grow somewhat large, we don't want to mark them for
inline as gcc tends to aggressively inline, creating larger than
expected executables.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add compiler/platform agnostic thread-local storage</title>
<updated>2008-11-18T18:32:53+00:00</updated>
<author>
<name>Andreas Ericsson</name>
<email>ae@op5.se</email>
</author>
<published>2008-11-18T18:06:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=36f0f61fc8578478a9dc9b33a1a0d07cdb98a5e5'/>
<id>36f0f61fc8578478a9dc9b33a1a0d07cdb98a5e5</id>
<content type='text'>
It doesn't cover all cases, but we can work on those as
we go along. For now, gcc, MSVC++, Intel C/C++, IBM XL C/C++,
Sun Studio C/C++ and Borland C++ Builder are the supported
compilers (although we boldly assume that they all are of
a recent enough version to support thread-local storage).

This is intended to be used in upcoming patches that implement
graceful (but TLS-dependant) error-handling in the library.

As an added bonus, we also bring the online_cpus() function
from git.git to detect the number of usable cpu's.

Signed-off-by: Andreas Ericsson &lt;ae@op5.se&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It doesn't cover all cases, but we can work on those as
we go along. For now, gcc, MSVC++, Intel C/C++, IBM XL C/C++,
Sun Studio C/C++ and Borland C++ Builder are the supported
compilers (although we boldly assume that they all are of
a recent enough version to support thread-local storage).

This is intended to be used in upcoming patches that implement
graceful (but TLS-dependant) error-handling in the library.

As an added bonus, we also bring the online_cpus() function
from git.git to detect the number of usable cpu's.

Signed-off-by: Andreas Ericsson &lt;ae@op5.se&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
