about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--torus.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/torus.h b/torus.h
index 23b4708..bb012f2 100644
--- a/torus.h
+++ b/torus.h
@@ -1,6 +1,7 @@
+#include <assert.h>
 #include <stdbool.h>
+#include <stddef.h>
 #include <stdint.h>
-#include <assert.h>
 
 #define ALIGNED(x) __attribute__((aligned(x)))
 
@@ -29,6 +30,8 @@ struct Tile {
     uint8_t colors[CELL_ROWS][CELL_COLS] ALIGNED(16);
 } ALIGNED(4096);
 static_assert(sizeof(struct Tile) == 4096, "struct Tile is page-sized");
+static_assert(offsetof(struct Tile, cells) == 16, "stable cells offset");
+static_assert(offsetof(struct Tile, colors) == 2016, "stable colors offset");
 
 #define TILE_ROWS (512)
 #define TILE_COLS (512)
816e0e01795d4edd923ddc&follow=1'>Add FILES sectionJune McEnroe 2019-08-22Remove gamesJune McEnroe 2019-04-04Mark card functions inlineJune McEnroe 2019-04-04Add listClearJune McEnroe 2019-04-03Tweak mouseButtonUp code a bitJune McEnroe 2019-04-03Check gameAvail on double-clickJune McEnroe 2019-04-02Select and move cards on mouse upJune McEnroe 2019-04-01Add idSkipJune McEnroe 2019-03-31Fix weird typoJune McEnroe 2019-03-30Add undo to freecellJune McEnroe 2019-03-29Replace path.h with asset.hJune McEnroe 2019-03-29Add king win faceJune McEnroe 2019-03-29Change king face directionJune McEnroe 2019-03-29Load king bitmaps in freecellJune McEnroe