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
4 changes: 2 additions & 2 deletions include/gcache/ghost_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GhostKvCache;
* Templated type Meta must have a field size_idx; in almost all cases, this
* field does not need to specified; it is only useful if there is some
* additional per-page metadata to be carried.
* To support cache size of differnet scales, we support templates numerical
* To support cache size of different scales, we support templates numerical
* type for cache size.
*/
template <typename Hash = ghash, typename Meta = GhostMeta<uint32_t>,
Expand Down Expand Up @@ -245,7 +245,7 @@ GhostCache<Hash, Meta, SizeType, HashType>::access_impl(SizeType block_id,
* 1) every node at boundary with size_idx < X should increase its size_idx
* and the boundary pointer shall move to its next.
* 2) X's size_idx should be set to 0.
* 3) if X itself is a boundary, set that boundary to X's next (sucessor).
* 3) if X itself is a boundary, set that boundary to X's next (successor).
*/
SizeType size_idx;
if (s) { // No new insertion
Expand Down
2 changes: 1 addition & 1 deletion include/gcache/ghost_kv_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class SampledGhostKvCache {
}
return curve;
// should be implicitly moved by compiler
// avoid explict move for Return Value Optimization (RVO)
// avoid explicit move for Return Value Optimization (RVO)
}
};
} // namespace gcache
6 changes: 3 additions & 3 deletions include/gcache/lru_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class LRUCache {
void pin(Handle_t handle);

/**
* The normal opeartions (`insert`/`lookup`/`release`) will only cause a node
* The normal operations (`insert`/`lookup`/`release`) will only cause a node
* to flow among the lru list, the in-use list, and the free list.
* Only `erase` will force a node to jump out of circulation, and only
* `install` may add a node. When a node is erased, its value is trashed
Expand Down Expand Up @@ -196,7 +196,7 @@ class LRUCache {
// This list is only maintained for memory efficiency purposes.
Node_t erased_;

// Pool for additionaly allocated handles.
// Pool for additionally allocated handles.
std::vector<Node_t*> extra_pool_;

template <typename H, typename M, typename ST, typename HT>
Expand Down Expand Up @@ -242,7 +242,7 @@ inline LRUCache<Key_t, Value_t, Hash>::~LRUCache() {
delete[] pool_;
delete table_;
}
/* `extrac_pool_` is always owned by this instance. */
/* `extra_pool_` is always owned by this instance. */
for (auto e : extra_pool_) delete e;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/test_ghost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void bench1() {
auto ts3 = rdtsc();

for (uint32_t i = 0; i < bench_size / 8; ++i) {
// manually flatten the loop, becaues we cannot turn on compiler
// manually flatten the loop, because we cannot turn on compiler
// optimization which will remove the whole loop since it produces nothing.
gcache::ghash{}(i * 8);
gcache::ghash{}(i * 8 + 1);
Expand Down Expand Up @@ -391,7 +391,7 @@ int main() {
test3(); // test checkpoint and recover
bench1(); // ghost cache w/o sampling
bench2(); // ghost cache w/ sampling
bench3(); // hit rate comparsion
bench3(); // hit rate comparison
bench4(); // large bench: may exceed CPU cache size
bench5(); // real random access
return 0;
Expand Down