diff options
-rw-r--r-- | asset.c | 6 | ||||
-rw-r--r-- | memory.c | 2 | ||||
-rw-r--r-- | memory.h | 2 |
3 files changed, 7 insertions, 3 deletions
@@ -1,8 +1,12 @@ +#include "memory.h" #include "pack.h" +#include "plat.h" #include "asset.h" const unsigned char* get_asset(Asset_ID id) { - return &asset_data[asset_offset_table[id]]; + const void* ptr = &asset_data[asset_offset_table[id]]; + assert(aligned(ptr, allocation_default_alignment)); + return ptr; } const struct Bitmap* get_bitmap(Asset_ID id) { @@ -3,7 +3,7 @@ #include <stdint.h> #include <stddef.h> -int aligned(void* p, int a) { +int aligned(const void* p, int a) { return (uintptr_t)p % a == 0; } @@ -1,7 +1,7 @@ #ifndef memory_h #define memory_h -int aligned(void* p, int a); +int aligned(const void* p, int a); int align_size(int s, int a); typedef struct Arena { |