MCPcopy Create free account
hub / github.com/Niko1221/Strata / insert

Method insert

engine/src/ngram/ple_reader.cpp:64–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 return nullptr;
63 }
64 void insert(uint32_t row, const uint8_t* bytes) {
65 if (sets == 0 || find(row) != nullptr) return;
66 const uint64_t s = mix(row) % sets;
67 uint32_t w = next[s];
68 next[s] = (uint8_t) ((w + 1) % WAYS);
69 if (keys[s * WAYS + w] == EMPTY) ++used;
70 keys[s * WAYS + w] = row;
71 std::memcpy(&data[(s * WAYS + w) * rb], bytes, rb);
72 }
73};
74
75struct Use {

Calls 3

memcpyFunction · 0.85
findFunction · 0.50
mixFunction · 0.50