Skip to content

Commit 8be14b4

Browse files
committed
add comments
1 parent a862a54 commit 8be14b4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

stacker/src/arena_hashmap.rs

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ use crate::shared_arena_hashmap::SharedArenaHashMap;
1010
/// The quirky API has the benefit of avoiding
1111
/// the computation of the hash of the key twice,
1212
/// or copying the key as long as there is no insert.
13+
///
14+
/// ArenaHashMap is like SharedArenaHashMap but takes ownership
15+
/// of the memory arena. The memory arena stores the serialized
16+
/// keys and values.
1317
pub struct ArenaHashMap {
1418
shared_arena_hashmap: SharedArenaHashMap,
1519
pub memory_arena: MemoryArena,

stacker/src/shared_arena_hashmap.rs

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ impl KeyValue {
5656
/// The quirky API has the benefit of avoiding
5757
/// the computation of the hash of the key twice,
5858
/// or copying the key as long as there is no insert.
59+
///
60+
/// SharedArenaHashMap is like ArenaHashMap but does the memory arena
61+
/// gets passed as an argument to the methods.
62+
/// So one MemoryArena can be shared with multiple SharedArenaHashMap.
5963
pub struct SharedArenaHashMap {
6064
table: Vec<KeyValue>,
6165
mask: usize,

0 commit comments

Comments
 (0)