summaryrefslogtreecommitdiff
path: root/lib/log.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2015-05-27 03:45:30 +0200
committerChristian Franke <nobody@nowhere.ws>2016-09-19 17:52:05 +0200
commit3b4cd7837562cd78fe80bde94f5aa6729b2f755d (patch)
tree236c4d7616d4e5aacede3398ec2975b734929874 /lib/log.c
parent6ba26ad5d2bc863917914db0d8354eb834bba264 (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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/log.c b/lib/log.c
index 9821483d69..1ecc5b6df6 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -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 *