Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/ComputeCxx/Graph/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class Graph::Context {
ClosureFunctionVV<void> _update_callback = {nullptr, nullptr};

uint64_t _deadline = UINT64_MAX;
uint64_t _graph_version;
bool _needs_update;
bool _invalidated;
uint64_t _graph_version = 0;
bool _needs_update = false;
bool _invalidated = false;

void call_invalidation(AttributeID attribute);

Expand Down
6 changes: 3 additions & 3 deletions Sources/ComputeCxx/Graph/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void Graph::add_subgraph(Subgraph &subgraph) {

void Graph::remove_subgraph(Subgraph &subgraph) {
auto iter = std::remove(_subgraphs.begin(), _subgraphs.end(), &subgraph);
_subgraphs.erase(iter);
_subgraphs.erase(iter, _subgraphs.end());

if (auto map = _tree_data_elements_by_subgraph.get()) {
auto iter = map->find(&subgraph);
Expand All @@ -247,7 +247,7 @@ void Graph::remove_subgraph(Subgraph &subgraph) {
if (subgraph.has_cached_nodes()) {
subgraph.set_has_cached_nodes(false);
auto iter = std::remove(_subgraphs_with_cached_nodes.begin(), _subgraphs_with_cached_nodes.end(), &subgraph);
_subgraphs_with_cached_nodes.erase(iter);
_subgraphs_with_cached_nodes.erase(iter, _subgraphs_with_cached_nodes.end());
}

_num_subgraphs -= 1;
Expand Down Expand Up @@ -2011,7 +2011,7 @@ void Graph::remove_trace(uint64_t trace_id) {
Trace *trace = *iter;
trace->end_trace(*this);
trace->trace_removed();
_traces.erase(iter);
_traces.erase(iter, _traces.end());
}
}

Expand Down
12 changes: 6 additions & 6 deletions Sources/ComputeCxx/Graph/Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class Graph {
vector<Trace *, 0, uint32_t> _traces;

// Main thread handler
MainHandler _Nullable _main_handler;
const void *_Nullable _main_handler_context;
MainHandler _Nullable _main_handler = nullptr;
const void *_Nullable _main_handler_context = nullptr;

// Metrics
uint64_t _num_nodes = 0;
Expand All @@ -98,20 +98,20 @@ class Graph {
uint64_t _num_value_bytes = 0;

// Trace recorder
TraceRecorder *_trace_recorder;
TraceRecorder *_trace_recorder = nullptr;

// Tree
std::unique_ptr<std::unordered_map<Subgraph *, TreeDataElement>> _tree_data_elements_by_subgraph;
KeyTable *_Nullable _keys;
KeyTable *_Nullable _keys = nullptr;

// Subgraphs
vector<Subgraph *, 0, uint32_t> _subgraphs;
vector<Subgraph *, 0, uint32_t> _subgraphs_with_cached_nodes;
vector<Subgraph *, 2, uint32_t> _invalidating_subgraphs;
bool _deferring_subgraph_invalidation;
bool _deferring_subgraph_invalidation = false;

// Threads
bool _needs_update;
bool _needs_update = false;
uint32_t _ref_count = 1;
pthread_t _current_update_thread = 0;

Expand Down
2 changes: 1 addition & 1 deletion Sources/ComputeCxx/Graph/UpdateStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Graph::UpdateStack::UpdateStack(Graph *graph, IAGGraphUpdateOptions options)

if (graph->_deferring_subgraph_invalidation == false) {
graph->_deferring_subgraph_invalidation = true;
_options = IAGGraphUpdateOptions(_options & IAGGraphUpdateOptionsEndDeferringSubgraphInvalidationOnExit);
_options = IAGGraphUpdateOptions(_options | IAGGraphUpdateOptionsEndDeferringSubgraphInvalidationOnExit); // set, not clear: the dtor checks this flag to reset _deferring_subgraph_invalidation
}

Graph::set_current_update(util::tagged_ptr<UpdateStack>(this, options & IAGGraphUpdateOptionsInitializeCleared));
Expand Down
10 changes: 5 additions & 5 deletions Sources/ComputeCxx/Subgraph/Subgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void Subgraph::remove_observer(IAGUniqueID observer_id) {
}
return false;
});
observers->erase(iter);
observers->erase(iter, observers->end());
}
}

Expand Down Expand Up @@ -204,7 +204,7 @@ void Subgraph::invalidate_now(Graph &graph) {
[&child](auto other_parent_child) -> bool {
return other_parent_child.subgraph() == child.subgraph();
});
other_parent->_children.erase(iter);
other_parent->_children.erase(iter, other_parent->_children.end());
}

child.subgraph()->_parents.clear();
Expand All @@ -224,7 +224,7 @@ void Subgraph::invalidate_now(Graph &graph) {
// its parents vector
auto iter =
std::remove(child.subgraph()->_parents.begin(), child.subgraph()->_parents.end(), subgraph);
child.subgraph()->_parents.erase(iter);
child.subgraph()->_parents.erase(iter, child.subgraph()->_parents.end());
}
}
}
Expand Down Expand Up @@ -356,7 +356,7 @@ void Subgraph::add_child(Subgraph &child, uint8_t tag) {

void Subgraph::remove_child(Subgraph &child, bool suppress_trace) {
auto parent_iter = std::remove(child._parents.begin(), child._parents.end(), this);
child._parents.erase(parent_iter);
child._parents.erase(parent_iter, child._parents.end());

if (!suppress_trace) {
graph()->foreach_trace([this, &child](Trace &trace) { trace.remove_child(*this, child); });
Expand All @@ -365,7 +365,7 @@ void Subgraph::remove_child(Subgraph &child, bool suppress_trace) {
auto child_iter = std::remove_if(_children.begin(), _children.end(), [&child](auto subgraph_child) -> bool {
return subgraph_child.subgraph() == &child;
});
_children.erase(child_iter);
_children.erase(child_iter, _children.end());
}

bool Subgraph::ancestor_of(const Subgraph &other) {
Expand Down
12 changes: 6 additions & 6 deletions Sources/ComputeCxx/Subgraph/Subgraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ class Subgraph : public data::zone {
uint64_t observer_id;
};
data::ptr<vector<Observer, 0, uint64_t> *> _observers;
uint32_t _traversal_seed;
uint32_t _index;
uint32_t _traversal_seed = 0;
uint32_t _index = 0;

data::ptr<NodeCache> _cache = nullptr;
Graph::TreeElementID _tree_root;

IAGAttributeFlags _flags;
IAGAttributeFlags _descendent_flags;
IAGAttributeFlags _dirty_flags;
IAGAttributeFlags _descendent_dirty_flags;
IAGAttributeFlags _flags = {};
IAGAttributeFlags _descendent_flags = {};
IAGAttributeFlags _dirty_flags = {};
IAGAttributeFlags _descendent_dirty_flags = {};

enum class InvalidationState : uint8_t {
None = 0,
Expand Down
2 changes: 1 addition & 1 deletion Sources/ComputeCxx/Vector/IndirectPointerVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class indirect_pointer_vector {
NullElement = 0x2,
};

uintptr_t _data;
uintptr_t _data = 0; // 0 == empty; `= default` ctor would otherwise leave this indeterminate

using vector_type = vector<value_type, 4, size_type>;

Expand Down