Skip to content

Commit

Permalink
Changes to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
skogseth committed Feb 13, 2024
1 parent 21f8f24 commit 4cd9e52
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/domains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ use crate::stack::SharedStack;

// -------------------------------------

/*
# Todo:
- Add options for caching:
-> Maximum size of cache?
-> Fixed size for cache?
-> Pre-allocated cache?
- Add option for bulk-reclaim (default to what?), use const generics?
- Test HashSet for cache (BTreeSet can't reuse allocation?)
*/

// -------------------------------------

/**
This variable can be used to configure the behavior of the domains provided by this crate
Expand All @@ -58,6 +45,11 @@ If you want to change the global config options then this can be done via [`GLOB
pub struct Config {
caching: bool,
bulk_size: usize,
/*
Other possible config options:
- Maximum/fixed size cache
- Pre-allocate cache?
*/
}

impl Config {
Expand Down Expand Up @@ -293,6 +285,7 @@ unsafe impl Domain for GlobalDomain {
let try_reclaim = |retired_ptrs: &mut Vec<RetiredPtr>| -> usize {
let prev_size = retired_ptrs.len();

// Check if it's too small to reclaim
if prev_size < global_config().bulk_size {
return 0;
}
Expand Down Expand Up @@ -424,7 +417,7 @@ unsafe impl Domain for SharedDomain {

let prev_size = retired_ptrs.len();

// Check if it's too small
// Check if it's too small to reclaim
if prev_size < global_config().bulk_size {
return 0;
}
Expand All @@ -446,7 +439,7 @@ unsafe impl Domain for SharedDomain {

let prev_size = retired_ptrs.len();

// Check if it's too small
// Check if it's too small to reclaim
if prev_size < global_config().bulk_size {
return 0;
}
Expand Down Expand Up @@ -587,7 +580,7 @@ unsafe impl Domain for LocalDomain {

let prev_size = retired_ptrs.len();

// Check if it's too small
// Check if it's too small to reclaim
if prev_size < global_config().bulk_size {
return 0;
}
Expand Down

0 comments on commit 4cd9e52

Please sign in to comment.