Commit 5fce97e6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5c46bf8e
...@@ -70,7 +70,7 @@ type LiveCache struct { ...@@ -70,7 +70,7 @@ type LiveCache struct {
// pinned objects. may have referees. // pinned objects. may have referees.
pinned map[Oid]IPersistent pinned map[Oid]IPersistent
// not pinned objects. may have referees. cache keeps weak reference to an object. // not pinned objects. may have referees. cache keeps weak references to objects.
// //
// rationale for using weakref: // rationale for using weakref:
// //
...@@ -149,20 +149,20 @@ const ( ...@@ -149,20 +149,20 @@ const (
// //
// Note: object's state can still be discarded and the object can go // Note: object's state can still be discarded and the object can go
// into ghost state. Use PCacheKeepState to prevent such automatic // into ghost state. Use PCacheKeepState to prevent such automatic
// state eviction until discard is really needed. // state eviction until state discard is semantically required.
PCachePinObject PCachePolicy = 1 << iota PCachePinObject PCachePolicy = 1 << iota
// don't keep object in the cache. // don't keep object in the cache.
// //
// The object will be discarded from the cache completely as soon as it // The object will be discarded from the cache completely as soon as it
// is semantically valid to do so. // is semantically valid to do so.
PCacheDiscardObject PCacheDropObject
PCacheOmitObject
// keep object state in the cache. // keep object state in the cache.
// //
// Object's state is kept XXX ... // This prevents object state to go away when !dirty object is no
// Note: object can go awai (PCachePinObject) // longer used. However the object itself can go away unless it is
// pinned into cache via PCachePinObject.
// //
// Note: on invalidation, state of invalidated objects is discarded // Note: on invalidation, state of invalidated objects is discarded
// unconditionally. // unconditionally.
...@@ -170,10 +170,10 @@ const ( ...@@ -170,10 +170,10 @@ const (
// don't keep object state. // don't keep object state.
// //
// Data access is non-temporal. Object's state is used once and then // Data access is likely non-temporal and object's state will be used
// won't be used for a long time. Don't pollute cache with state of // once and then won't be used for a long time. Don't pollute cache
// this object. // with state of this object.
PCacheOmitState PCacheDropState
) )
// ---------------------------------------- // ----------------------------------------
......
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