Name |
Last commit
|
Last update |
---|---|---|
.. | ||
.gitignore | ||
t0000-errno.c | ||
t0000-hash.c | ||
t0000-obj-hash.c | ||
t0000-obj.c | ||
t0000-oid.c | ||
t0000-read1.c | ||
t0000-read2.c | ||
test_lib.c | ||
test_lib.h | ||
test_main.c |
The Mach-O format does not permit gcc to implement the __thread TLS specification, so we must instead emulate it using a single int cell allocated from memory and stored inside of the thread specific data associated with the current pthread. What makes this tricky is git_errno must be a valid lvalue, so we really need to return a pointer to the caller and deference it as part of the git_errno macro. The GCC-specific __attribute__((constructor)) extension is used to ensure the pthread_key_t is allocated before any Git functions are executed in the library, as this is necessary to access our thread specific storage. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
.gitignore | Loading commit data... | |
t0000-errno.c | Loading commit data... | |
t0000-hash.c | Loading commit data... | |
t0000-obj-hash.c | Loading commit data... | |
t0000-obj.c | Loading commit data... | |
t0000-oid.c | Loading commit data... | |
t0000-read1.c | Loading commit data... | |
t0000-read2.c | Loading commit data... | |
test_lib.c | Loading commit data... | |
test_lib.h | Loading commit data... | |
test_main.c | Loading commit data... |