Commit 6826989c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4e115473
...@@ -48,9 +48,7 @@ type Connection struct { ...@@ -48,9 +48,7 @@ type Connection struct {
stor IStorage // underlying storage stor IStorage // underlying storage
db *DB // Connection is part of this DB db *DB // Connection is part of this DB
txn transaction.Transaction // opened under this txn; nil if idle in DB pool. txn transaction.Transaction // opened under this txn; nil if idle in DB pool.
at Tid // current view of database; stable inside a transaction.
// current view of database; stable inside a transaction.
at Tid
// {} oid -> obj // {} oid -> obj
// //
...@@ -65,7 +63,8 @@ type Connection struct { ...@@ -65,7 +63,8 @@ type Connection struct {
// references to it from other objects: // references to it from other objects:
// //
// - deactivate will release obj state (ok) // - deactivate will release obj state (ok)
// - but there will be still reference from connection `oid -> obj` map to this object. // - but there will be still reference from connection `oid -> obj` map to this object,
// which means the object won't be garbage-collected.
// //
// -> we can solve it by using "weak" pointers in the map. // -> we can solve it by using "weak" pointers in the map.
// //
...@@ -98,7 +97,7 @@ type Connection struct { ...@@ -98,7 +97,7 @@ type Connection struct {
// https://groups.google.com/forum/#!topic/golang-nuts/PYWxjT2v6ps // https://groups.google.com/forum/#!topic/golang-nuts/PYWxjT2v6ps
// //
// NOTE2 finalizers don't run on when they are attached to an object in cycle. // NOTE2 finalizers don't run on when they are attached to an object in cycle.
// Hopefully we don't have cycles with ZBTree/ZBucket XXX verify this // Hopefully we don't have cycles with BTree/Bucket.
objmu sync.Mutex objmu sync.Mutex
objtab map[Oid]*weak.Ref // oid -> weak.Ref(IPersistent) objtab map[Oid]*weak.Ref // oid -> weak.Ref(IPersistent)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment