|
0c4d24da
|
2021-11-14T02:24:39
|
|
Fix a gcc 11 warning in src/threadstate.c
When building under gcc 11, there is a warning about a misaligned guard clause
because there were mixed spaces and tabs:
```
[128/634] Building C object src/CMakeFiles/git2internal.dir/threadstate.c.o
../src/threadstate.c: In function ‘threadstate_dispose’:
../src/threadstate.c:39:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
39 | if (threadstate->error_t.message != git_str__initstr)
| ^~
../src/threadstate.c:41:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
41 | threadstate->error_t.message = NULL;
| ^~~~~~~~~~~
../src/threadstate.c: At top level:
```
This change indents the code with tabs for consistency with the rest of the
code, which makes the warning go away.
|
|
f0e693b1
|
2021-09-07T17:53:49
|
|
str: introduce `git_str` for internal, `git_buf` is external
libgit2 has two distinct requirements that were previously solved by
`git_buf`. We require:
1. A general purpose string class that provides a number of utility APIs
for manipulating data (eg, concatenating, truncating, etc).
2. A structure that we can use to return strings to callers that they
can take ownership of.
By using a single class (`git_buf`) for both of these purposes, we have
confused the API to the point that refactorings are difficult and
reasoning about correctness is also difficult.
Move the utility class `git_buf` to be called `git_str`: this represents
its general purpose, as an internal string buffer class. The name also
is an homage to Junio Hamano ("gitstr").
The public API remains `git_buf`, and has a much smaller footprint. It
is generally only used as an "out" param with strict requirements that
follow the documentation. (Exceptions exist for some legacy APIs to
avoid breaking callers unnecessarily.)
Utility functions exist to convert a user-specified `git_buf` to a
`git_str` so that we can call internal functions, then converting it
back again.
|
|
27f50a66
|
2021-09-02T18:59:19
|
|
#6028: Check if `threadstate->error_t.message` is not `git_buf__initbuf` before freeing.
This follows the same principle as `buffer.c` where the same check is done before freeing the buffer. It fixes the crash described in #6028.
|
|
20ce17f0
|
2020-08-06T16:24:27
|
|
Replace global storage TLS with new interface
|
|
246bc3cc
|
2020-10-14T15:05:11
|
|
threadstate: rename tlsdata when building w/o threads
|
|
e316b0d3
|
2020-05-15T11:47:09
|
|
runtime: move init/shutdown into the "runtime"
Provide a mechanism for system components to register for initialization
and shutdown of the libgit2 runtime.
|
|
4853d94c
|
2020-05-14T10:36:35
|
|
global: separate global state from thread-local state
Our "global initialization" has accumulated some debris over the years.
It was previously responsible for both running the various global
initializers (that set up various subsystems) _and_ setting up the
"global state", which is actually the thread-local state for things
like error reporting.
Separate the thread local state out into "threadstate". Use the normal
subsystem initialization functions that we already have to set it up.
This makes both the global initialization system and the threadstate
system simpler to reason about.
|