libstand - Fix excessive memory use by hammer2 module
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 2 Apr 2014 21:38:54 +0000 (14:38 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 2 Apr 2014 21:38:54 +0000 (14:38 -0700)
commitf5ad3ecb7f214a88dec9c9567bc9c934e24b64e0
tree7a5cd0693e39f586f95976770c0ec5cd995a2c94
parent902419bf6d9fd0f80afc9d07cd4b3e99d20f23ca
libstand - Fix excessive memory use by hammer2 module

* Don't try to dynamically allocate 64KB for each open file.  Just use
  the same static media buffer that normal operations use.

  This fixes some severe heap fragmentation and out-of-memory issues
  when a lot (20+) modules are specified in /boot/loader.conf that
  can cause the boot loader to fail.

* Add getheap() to retrieve heap stats.
lib/libstand/hammer2.c
lib/libstand/sbrk.c
lib/libstand/stand.h