pike.git/
src/
block_allocator.c
Branch:
Tag:
Non-build tags
All tags
No tags
2014-12-04
2014-12-04 19:23:41 by Arne Goedeke <el@laramies.com>
7b32a6b5494ed1ead48439fbeab0aa780ff8a66a (
11
lines) (+
8
/-
3
)
[
Show
|
Annotate
]
Branch:
bill/master_archive_support
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) {