Skip to content

Commit

Permalink
Fix GarbageCollect policy for corner cases (#1696)
Browse files Browse the repository at this point in the history
* Fix GarbageCollect policy for corner cases

* oops
  • Loading branch information
yellowhatter authored Jan 8, 2025
1 parent c5709d0 commit 5764ab5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commons/zenoh-shm/src/api/provider/shm_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ where
provider: &ShmProvider<IDSource, Backend>,
) -> ChunkAllocResult {
let result = InnerPolicy::alloc(layout, provider);
if let Err(ZAllocError::OutOfMemory) = result {
if result.is_err() {
// try to alloc again only if GC managed to reclaim big enough chunk
if provider.garbage_collect() >= layout.size().get() {
return AltPolicy::alloc(layout, provider);
Expand Down

0 comments on commit 5764ab5

Please sign in to comment.