Skip to content

Commit

Permalink
fix overflow bug
Browse files Browse the repository at this point in the history
Signed-off-by: Little-Wallace <[email protected]>
  • Loading branch information
Little-Wallace committed Mar 15, 2024
1 parent 70d2248 commit ab953a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compute/src/memory/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub fn storage_memory_config(

if meta_cache_capacity_mb != default_meta_cache_capacity_mb {
default_block_cache_capacity_mb += default_meta_cache_capacity_mb;
default_block_cache_capacity_mb -= meta_cache_capacity_mb;
default_block_cache_capacity_mb = default_block_cache_capacity_mb.saturating_sub(meta_cache_capacity_mb);
}

let default_shared_buffer_capacity_mb = ((non_reserved_memory_bytes as f64
Expand All @@ -112,7 +112,7 @@ pub fn storage_memory_config(
));
if shared_buffer_capacity_mb != default_shared_buffer_capacity_mb {
default_block_cache_capacity_mb += default_shared_buffer_capacity_mb;
default_block_cache_capacity_mb -= shared_buffer_capacity_mb;
default_block_cache_capacity_mb = default_block_cache_capacity_mb.saturating_sub(shared_buffer_capacity_mb);
}
let block_cache_capacity_mb = storage_config
.block_cache_capacity_mb
Expand Down

0 comments on commit ab953a9

Please sign in to comment.