Commit 6e4099e8 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

ws: Less magic for the workspace end marker

parent 4fea4257
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include <stdio.h> #include <stdio.h>
#define WS_REDZONE_END '\x15'
static const void * const snap_overflowed = &snap_overflowed; static const void * const snap_overflowed = &snap_overflowed;
void void
...@@ -60,7 +62,7 @@ WS_Assert(const struct ws *ws) ...@@ -60,7 +62,7 @@ WS_Assert(const struct ws *ws)
assert(ws->r <= ws->e); assert(ws->r <= ws->e);
assert(PAOK(ws->r)); assert(PAOK(ws->r));
} }
assert(*ws->e == 0x15); assert(*ws->e == WS_REDZONE_END);
} }
int int
...@@ -105,7 +107,7 @@ WS_Init(struct ws *ws, const char *id, void *space, unsigned len) ...@@ -105,7 +107,7 @@ WS_Init(struct ws *ws, const char *id, void *space, unsigned len)
assert(PAOK(space)); assert(PAOK(space));
len = PRNDDN(len - 1); len = PRNDDN(len - 1);
ws->e = ws->s + len; ws->e = ws->s + len;
*ws->e = 0x15; *ws->e = WS_REDZONE_END;
ws->f = ws->s; ws->f = ws->s;
assert(id[0] & 0x20); // cheesy islower() assert(id[0] & 0x20); // cheesy islower()
bstrcpy(ws->id, id); bstrcpy(ws->id, id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment