on master help sign in
Add note about invariants
18e632bNeil Mitchell
gen/test.c+1
@@ -39,6 +39,7 @@ typedef struct
39 // when you commit, you copy over from end to front
39 // when you commit, you copy over from end to front
40
40
41 // nodes
41 // nodes
42+ // Invariant: Always at least one free spot (to do copying from front to back)
42 int size;
43 int size;
43 int used_front; // front entries, stored for good
44 int used_front; // front entries, stored for good
44 int used_back; // back entries, stack based, copied into front on </close>
45 int used_back; // back entries, stack based, copied into front on </close>