From 835b293d35a209d38047126443d41fa7090daa4c Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 19 Jun 2017 21:20:57 +0200 Subject: Use our own variant of 'assert' and 'assert_perror'. Our variants print stack traces on failures. This will make locating errors much easier. --- libhurd-slab/slab.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libhurd-slab') diff --git a/libhurd-slab/slab.c b/libhurd-slab/slab.c index 5a12a43a..f66bfddf 100644 --- a/libhurd-slab/slab.c +++ b/libhurd-slab/slab.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -107,7 +107,7 @@ deallocate_buffer (struct hurd_slab_space *space, void *buffer, size_t size) static void insert_slab (struct hurd_slab_space *space, struct hurd_slab *slab) { - assert (slab->refcount == 0); + assert_backtrace (slab->refcount == 0); if (space->slab_first == 0) space->slab_first = space->slab_last = slab; else @@ -214,7 +214,7 @@ init_space (hurd_slab_space_t space) /* If SIZE is so big that one object can not fit into a page something gotta be really wrong. */ size = (size + alignment - 1) & ~(alignment - 1); - assert (size <= (space->slab_size + assert_backtrace (size <= (space->slab_size - sizeof (struct hurd_slab) - sizeof (union hurd_bufctl))); @@ -488,7 +488,7 @@ put_on_slab_list (struct hurd_slab *slab, union hurd_bufctl *bufctl) bufctl->next = slab->free_list; slab->free_list = bufctl; slab->refcount--; - assert (slab->refcount >= 0); + assert_backtrace (slab->refcount >= 0); } @@ -499,7 +499,7 @@ hurd_slab_dealloc (hurd_slab_space_t space, void *buffer) struct hurd_slab *slab; union hurd_bufctl *bufctl; - assert (space->initialized); + assert_backtrace (space->initialized); pthread_mutex_lock (&space->lock); -- cgit v1.2.3