GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use parking_lot's Mutex in BlobSet, so TxState is the same size on ma… · clockworklabs/SpacetimeDB@8932a5a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • crates/table/src/tiered
    • blob_set.rs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎crates/table/src/tiered/blob_set.rs‎

Copy file name to clipboardExpand all lines: crates/table/src/tiered/blob_set.rs
+4-8Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
use super::metrics::{CacheTier, EvictionDirection, ObjectType};
2-
use std::{
3-
num::NonZeroUsize,
4-
ops::Deref,
5-
sync::{Arc, Mutex},
6-
};
2+
use std::{num::NonZeroUsize, ops::Deref, sync::Arc};
73

8-
use parking_lot::RwLock;
4+
use parking_lot::{Mutex, RwLock};
95
use spacetimedb_data_structures::{
106
map::{hash_map, IntMap},
117
small_map::SmallHashMap,
@@ -120,7 +116,7 @@ impl BlobSet {
120116
return Ok(bytes_freed);
121117
}
122118

123-
let mut candidates = self.evictable.lock().unwrap();
119+
let mut candidates = self.evictable.lock();
124120
self.resident.evictable_blobs(&mut candidates);
125121
for candidate in candidates.drain(..) {
126122
let maybe_resident = self.entries.read().get(&candidate.key).and_then(|entry| match entry {
@@ -546,7 +542,7 @@ impl BlobSet {
546542
impl MemoryUsage for BlobSet {
547543
fn heap_usage(&self) -> usize {
548544
// Cache and backing store are counted by `TieredDatabaseStorage`.
549-
let scratch = self.evictable.lock().unwrap().capacity() * size_of::<BlobEvictionCandidate>();
545+
let scratch = self.evictable.lock().capacity() * size_of::<BlobEvictionCandidate>();
550546

551547
self.entries.read().heap_usage() + scratch
552548
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.