aboutsummaryrefslogtreecommitdiff
path: root/object/store/packed
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-28 15:44:15 +0000
committerGravatar Runxi Yu2026-03-28 15:44:15 +0000
commit3709c0f3541b3b067b35025b517b80631b161a95 (patch)
treeab0b1f47a8f5c785889c719e9535e214b6537216 /object/store/packed
parentobject/store/memory: Update docs (diff)
signatureNo signature
object/store/packed: Update docs
Diffstat (limited to 'object/store/packed')
-rw-r--r--object/store/packed/close.go5
-rw-r--r--object/store/packed/new.go2
-rw-r--r--object/store/packed/read_reader.go10
-rw-r--r--object/store/packed/store.go4
4 files changed, 5 insertions, 16 deletions
diff --git a/object/store/packed/close.go b/object/store/packed/close.go
index f05a8573..6c61e4e6 100644
--- a/object/store/packed/close.go
+++ b/object/store/packed/close.go
@@ -1,11 +1,6 @@
package packed
// Close releases mapped pack/index resources associated with the store.
-//
-// Store borrows its root, so Close does not close it.
-// Close releases cached pack/index mappings retained by the store.
-//
-// Repeated calls to Close are undefined behavior.
func (store *Store) Close() error {
store.stateMu.Lock()
packs := store.packs
diff --git a/object/store/packed/new.go b/object/store/packed/new.go
index a4d1752d..0668268e 100644
--- a/object/store/packed/new.go
+++ b/object/store/packed/new.go
@@ -8,6 +8,8 @@ import (
)
// New creates a packed-object store rooted at an objects/pack directory.
+//
+// Labels: Deps-Borrowed.
func New(root *os.Root, algo objectid.Algorithm, opts Options) (*Store, error) {
if algo.Size() == 0 {
return nil, objectid.ErrInvalidAlgorithm
diff --git a/object/store/packed/read_reader.go b/object/store/packed/read_reader.go
index 0608e390..03e70628 100644
--- a/object/store/packed/read_reader.go
+++ b/object/store/packed/read_reader.go
@@ -15,11 +15,6 @@ import (
// ReadReaderContent reads an object's type, declared content size, and content
// stream.
//
-// The caller must close the returned reader.
-//
-// For base pack entries, the returned reader borrows store-owned mapped pack
-// data and is only valid until the store is closed.
-//
// Close releases reader-local resources only. It does not drain unread data for
// additional validation. In particular, malformed trailing compressed data,
// trailing bytes past the declared object size, and the zlib Adler-32 trailer
@@ -57,11 +52,6 @@ func (store *Store) ReadReaderContent(id objectid.ObjectID) (objecttype.Type, in
// ReadReaderFull reads a full serialized object stream as "type size\0content".
//
-// The caller must close the returned reader.
-//
-// For base pack entries, the returned reader borrows store-owned mapped pack
-// data and is only valid until the store is closed.
-//
// Close releases reader-local resources only. It does not drain unread data for
// additional validation. In particular, malformed trailing compressed data,
// trailing bytes past the declared object size, and the zlib Adler-32 trailer
diff --git a/object/store/packed/store.go b/object/store/packed/store.go
index ef8a5eaf..2faa8df3 100644
--- a/object/store/packed/store.go
+++ b/object/store/packed/store.go
@@ -12,7 +12,9 @@ import (
// Store reads Git objects from pack/index files under an objects/pack root.
//
-// Store borrows its root. Cached pack/index mappings are retained until Close.
+// Cached pack/index mappings are retained until Close.
+//
+// Labels: Close-Caller.
type Store struct {
// root is the borrowed objects/pack capability used for all file access.
root *os.Root