diff options
| author | Carlos MartÃn Nieto <[email protected]> | 2015-04-21 13:14:22 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <[email protected]> | 2015-05-22 09:02:24 +0200 |
| commit | 7750e85fd1ff1006a28a5e292c9bc7ce3e12b586 (patch) | |
| tree | 73178aaba5dbd83c81cc925f16fbd6cc9004a121 /git.go | |
| parent | 193deb7ae3cbc5d5a1f7f186aae6edb20bff950a (diff) | |
Introduce an indirection layer for pointers
As the Go runtime can move stacks at any point and the C code runs
concurrently with the rest of the system, we cannot assume that the
payloads we give to the C code will stay valid for any particular
duration.
We must therefore give the C code handles which we can then look up in
our own list when the callbacks get called.
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -93,7 +93,11 @@ var ( ErrInvalid = errors.New("Invalid state for operation") ) +var pointerHandles *HandleList + func init() { + pointerHandles = NewHandleList() + C.git_libgit2_init() // This is not something we should be doing, as we may be |
