*/
struct ws {
+ unsigned magic;
+#define WS_MAGIC 0x35fac554
const char *id; /* identity */
char *s; /* (S)tart of buffer */
char *f; /* (F)ree pointer */
WS_Assert(const struct ws *ws)
{
- assert(ws != NULL);
+ CHECK_OBJ_NOTNULL(ws, WS_MAGIC);
WS_DEBUG((SLT_Debug, 0, "WS(%p = (%s, %p %u %u %u)",
ws, ws->id, ws->s, pdiff(ws->s, ws->f),
ws->r == NULL ? 0 : pdiff(ws->f, ws->r),
WS_DEBUG((SLT_Debug, 0, "WS_Init(%p, \"%s\", %p, %u)", ws, id, space, len));
assert(space != NULL);
memset(ws, 0, sizeof *ws);
+ ws->magic = WS_MAGIC;
ws->s = space;
ws->e = ws->s + len;
ws->f = ws->s;