Add support for mempack #448

Merged
lhchavez merged 4 commits from mempack into master 2019-01-15 13:46:55 -06:00
lhchavez commented 2018-07-07 18:19:29 -05:00 (Migrated from github.com)

This allows the creation of git packfiles without needing to write them
to the filesystem.

This allows the creation of git packfiles without needing to write them to the filesystem.
carlosmn (Migrated from github.com) reviewed 2019-01-07 15:15:52 -06:00
carlosmn (Migrated from github.com) commented 2019-01-07 15:12:49 -06:00

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn (Migrated from github.com) commented 2019-01-07 15:13:26 -06:00

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn (Migrated from github.com) commented 2019-01-07 15:15:35 -06:00

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
@ -0,0 +69,4 @@
runtime.KeepAlive(repository)
if ret < 0 {
return nil, MakeGitError(ret)
}
carlosmn (Migrated from github.com) commented 2019-01-07 15:14:42 -06:00

We need to keep repository alive until here, or the runtime might free it.

We need to keep `repository` alive until here, or the runtime might free it.
carlosmn commented 2019-01-07 17:59:39 -06:00 (Migrated from github.com)

Actually since ownership transfers to the repository and the freeing only happens in the constructor, there is no need for a finalizer or Mempack.Free() at all.

Actually since ownership transfers to the repository and the freeing only happens in the constructor, there is no need for a finalizer or `Mempack.Free()` at all.
lhchavez (Migrated from github.com) reviewed 2019-01-07 20:47:30 -06:00
lhchavez (Migrated from github.com) left a comment

done, also added some tests, which uncovered the fact that repository needs to be non-null to prevent a SIGSEGV inside git_mempack_dump, so removed a nil-check.

done, also added some tests, which uncovered the fact that `repository` needs to be non-null to prevent a SIGSEGV inside `git_mempack_dump`, so removed a nil-check.
lhchavez (Migrated from github.com) commented 2019-01-07 20:46:07 -06:00

Removed

Removed
lhchavez (Migrated from github.com) commented 2019-01-07 20:46:23 -06:00

Removed

Removed
lhchavez (Migrated from github.com) commented 2019-01-07 20:46:29 -06:00

Removed.

Removed.
@ -0,0 +69,4 @@
runtime.KeepAlive(repository)
if ret < 0 {
return nil, MakeGitError(ret)
}
lhchavez (Migrated from github.com) commented 2019-01-07 20:46:16 -06:00

Done

Done
carlosmn commented 2019-01-15 13:46:52 -06:00 (Migrated from github.com)

Thanks, I added an extra keepalive that was missing (these are so annoying).

Thanks, I added an extra keepalive that was missing (these are _so_ annoying).
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jcarr/git2go#448
No description provided.