From 15e06e4d2ed21c3c0f8d330a85e27a4100357567 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 3 Jul 2019 13:56:56 -0700 Subject: [PATCH] ircd::allocator: Use stack for pretty(iec()) format buffers. --- ircd/allocator.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ircd/allocator.cc b/ircd/allocator.cc index bcb072003..953527c8b 100644 --- a/ircd/allocator.cc +++ b/ircd/allocator.cc @@ -32,16 +32,17 @@ ircd::allocator::info(const mutable_buffer &buf) ::mallinfo() }; - out << "arena: " << pretty(iec(ma.arena)) << std::endl + char pbuf[96]; + out << "arena: " << pretty(pbuf, iec(ma.arena)) << std::endl << "ordblks: " << ma.ordblks << std::endl << "smblks: " << ma.smblks << std::endl << "hblks: " << ma.hblks << std::endl - << "hblkhd: " << pretty(iec(ma.hblkhd)) << std::endl - << "usmblks: " << pretty(iec(ma.usmblks)) << std::endl - << "fsmblks: " << pretty(iec(ma.fsmblks)) << std::endl - << "uordblks: " << pretty(iec(ma.uordblks)) << std::endl - << "fordblks: " << pretty(iec(ma.fordblks)) << std::endl - << "keepcost: " << pretty(iec(ma.keepcost)) << std::endl + << "hblkhd: " << pretty(pbuf, iec(ma.hblkhd)) << std::endl + << "usmblks: " << pretty(pbuf, iec(ma.usmblks)) << std::endl + << "fsmblks: " << pretty(pbuf, iec(ma.fsmblks)) << std::endl + << "uordblks: " << pretty(pbuf, iec(ma.uordblks)) << std::endl + << "fordblks: " << pretty(pbuf, iec(ma.fordblks)) << std::endl + << "keepcost: " << pretty(pbuf, iec(ma.keepcost)) << std::endl ; return view(out, buf);