pike.git/
src/
block_allocator.c
Branch:
Tag:
Non-build tags
All tags
No tags
2013-06-13
2013-06-13 21:35:42 by Arne Goedeke <el@laramies.com>
0e4e9344d18f3c1c037cc32c0dfab799ad2180b7 (
11
lines) (+
8
/-
3
)
[
Show
|
Annotate
]
Branch:
7.9
block_alloc: memusage stats could overflow
89:
} PMOD_EXPORT void ba_count_all(const struct block_allocator * a, size_t * num, size_t * size) {
+
if (a->size) {
size_t n = (a->l.blocks << (a->size-1)) - a->l.blocks; *num = n; *size = a->l.block_size * n;
-
+
} else {
+
*num = *size = 0;
}
-
+
}
static void ba_low_alloc(struct block_allocator * a) { if (a->l.offset) {