Static Public Member Functions |
static Set * | ancestors (const Set &roots) |
| Ancestors of a set of Provenance objects.
|
static Set * | descendants (const Set &roots) |
| Descendants of a set of Provenance objects.
|
static void * | operator new (size_t bytes) |
| Allocate memory.
|
static void * | operator new (size_t, void *where) |
| Placement new for GCNode.
|
static void | operator delete (void *p, size_t bytes) |
| Deallocate memory.
|
static bool | check () |
| Integrity check.
|
template<class T > |
static T * | expose (T *node) |
| Record that construction of a node is complete.
|
static void | gc () |
| Initiate a garbage collection.
|
static void | gclite () |
| Lightweight garbage collection.
|
static void | maybeCheckExposed (const GCNode *node) |
| Subject to configuration, check that a GCNode is exposed.
|
static size_t | numNodes () |
| Number of GCNode objects in existence.
|
Provenance of a Frame::Binding state.
This class records the provenance of an R binding, or more accurately the provenance of the state of an R binding at a particular time, where the state of a Frame::Binding in particular includes its value. However, for brevity, in the documentation of this class we will use the expression "this
binding" to refer to the Frame::Binding object, and the state of that Frame::Binding object, to which this Provenance object relates. (It should be understood that this Frame::Binding object may subsequently have changed its state, or ceased to exist altogether.)
In particular a Provenance object records the time this binding was established, and the top-level command that gave rise to it. It also maintains links to information about the provenance of the parents and children of the binding. The parents of a binding state b are the binding states which were read by the top-level command before creating the binding state b, and may therefore have influenced the state b; children are defined analogously.
- Xenogenesis:
- Normally the value (and more generally) the state of a binding created during the evaluation of a top-level command will depend solely on the values of bindings previously read during the evaluation of that top-level command, and possibly on other aspects of the internal state of the R interpreter when evaluation of the command started. If this is not the case, then the binding (state) is described as xenogenous, and this property is recorded in the Provenance object. Moreover, if a binding is xenogenous, the value of the binding is also recorded within the Provenance object.
void CXXR::Provenance::detachReferents |
( |
| ) |
|
|
virtual |
Null out all references from this node to other nodes.
The referents of this node are those objects (derived from GCNode) designated by a GCEdge within this object. This function changes all GCEdges within this object to encapsulate a null pointer. It is used during the sweep phase of a mark-sweep garbage collection to break up unreachable subgraphs, and in particular to remove reference loops from them. After the application of this method, the GCNode should be regarded as a 'zombie', kept in existence only so other nodes can detach their references to it cleanly (using decRefCount()).
- Note:
- If this method is reimplemented in a derived class, the reimplemented version must remember to invoke detachReferents() for the immediate base class of the derived class, to ensure that all referents of the object get detached.
Reimplemented from CXXR::GCNode.