diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2015-05-27 03:45:30 +0200 |
|---|---|---|
| committer | Christian Franke <nobody@nowhere.ws> | 2016-09-19 17:52:05 +0200 |
| commit | 3b4cd7837562cd78fe80bde94f5aa6729b2f755d (patch) | |
| tree | 236c4d7616d4e5aacede3398ec2975b734929874 /lib/log.c | |
| parent | 6ba26ad5d2bc863917914db0d8354eb834bba264 (diff) | |
lib: add new extensible memory-type handling
This rewrites Quagga's memory per-type allocation counting, without
using a fixed global list of types. Instead, source files can declare
memory types which get handled through constructor functions called by
the dynamic linker during startup.
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[DL: v3: forgot "nonnull" attribute on XFREE]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/log.c')
| -rw-r--r-- | lib/log.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -680,6 +680,14 @@ _zlog_assert_failed (const char *assertion, const char *file, abort(); } +void +memory_oom (size_t size, const char *name) +{ + zlog_err("out of memory: failed to allocate %zu bytes for %s" + "object", size, name); + zlog_backtrace(LOG_ERR); + abort(); +} /* Open log stream */ struct zlog * |
