File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 5
5
#include < boost/noncopyable.hpp>
6
6
#include < memory>
7
7
8
+ /* *
9
+ * Tracker for if an element needs to be revisited later in the process, also
10
+ * known as "pending". This information used to be stored in the database, but
11
+ * is ephemeral and lead to database churn, bloat, and was generally slow.
12
+ * An initial re-implementation stored it as a std::set<osmid_t>, which worked
13
+ * but was inefficient with memory overhead and pointer chasing.
14
+ *
15
+ * Instead, the size of the leaf nodes is increased. This was initially a
16
+ * vector<bool>, but the cost of exposing the iterator was too high.
17
+ * Instead, it's a uint32, with a function to find the next bit set in the block
18
+ *
19
+ * These details aren't exposed in the public interface, which just has
20
+ * pop_mark.
21
+ */
8
22
struct id_tracker : public boost ::noncopyable {
9
23
id_tracker ();
10
24
~id_tracker ();
11
25
12
26
void mark (osmid_t id);
13
27
bool is_marked (osmid_t id);
28
+ /* *
29
+ * Finds an osmid_t that is marked
30
+ */
14
31
osmid_t pop_mark ();
15
32
size_t size ();
16
33
osmid_t last_returned () const ;
You can’t perform that action at this time.
0 commit comments