Skip to content

Commit 1a7c8e8

Browse files
authored
Merge pull request #232 from japaric/fix-pool-capacity-report
fix return value of `Pool::grow` on x86_64
2 parents f49f967 + 0d721bf commit 1a7c8e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pool/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,15 +359,16 @@ impl<T> Pool<T> {
359359
() => {
360360
if let Some(p) = Ptr::new(p as *mut _) {
361361
self.stack.push(p);
362+
n += 1;
362363
}
363364
}
364365

365366
#[cfg(not(target_arch = "x86_64"))]
366367
() => {
367368
self.stack.push(unsafe { Ptr::new_unchecked(p as *mut _) });
369+
n += 1;
368370
}
369371
}
370-
n += 1;
371372

372373
p = unsafe { p.add(sz) };
373374
len -= sz;

0 commit comments

Comments
 (0)