From f6279181bb0a919b8547333a62704495213bfbc7 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 29 Sep 2020 12:36:13 -0700 Subject: [PATCH] u3: adds debug assertion for atom-allocation internal invariant --- pkg/urbit/noun/imprison.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/urbit/noun/imprison.c b/pkg/urbit/noun/imprison.c index c3630ce30..71d530e6d 100644 --- a/pkg/urbit/noun/imprison.c +++ b/pkg/urbit/noun/imprison.c @@ -33,6 +33,10 @@ _ci_slab_init(u3i_slab* sab_u, c3_w len_w) vat_u->mug_w = 0; vat_u->len_w = len_w; +#ifdef U3_MEMORY_DEBUG + c3_assert( len_w ); +#endif + sab_u->_._vat_u = vat_u; sab_u->buf_w = vat_u->buf_w; sab_u->len_w = len_w;