We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb41318 commit 105af93Copy full SHA for 105af93
libs/onesize/onesize.c
@@ -57,6 +57,13 @@ void *am_onesize_allocate(struct am_onesize *hnd, int size) {
57
struct am_slist_item *elem = am_slist_pop_front(&hnd->fl);
58
AM_ASSERT(elem);
59
60
+ /*
61
+ * make sure that onesize freelist bookkeeping state
62
+ * was not corrupted by someone
63
+ */
64
+ AM_ASSERT((void *)elem >= hnd->pool.ptr);
65
+ AM_ASSERT((void *)elem < (void *)((char *)hnd->pool.ptr + hnd->pool.size));
66
+
67
AM_ASSERT(hnd->nfree);
68
--hnd->nfree;
69
hnd->minfree = AM_MIN(hnd->minfree, hnd->nfree);
0 commit comments