From 2831e25ba58603a3f557cc18516c30760bee2a42 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 5 Jun 2024 12:46:23 -0400 Subject: [PATCH] sily --- CMakeLists.txt | 2 +- examples/main.cpp | 11 +++++++++++ include/blt/gp/program.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 400113a..9e48988 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(blt-gp VERSION 0.0.9) +project(blt-gp VERSION 0.0.10) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) diff --git a/examples/main.cpp b/examples/main.cpp index a501c71..dafb019 100644 --- a/examples/main.cpp +++ b/examples/main.cpp @@ -271,9 +271,20 @@ void test() } +struct silly +{ + long nyah; + int bruh; +}; + int main() { test(); + std::cout << alignof(silly) << " " << sizeof(silly) << std::endl; + + blt::size_t remaining_bytes = 4096; + //auto* pointer = static_cast(head->metadata.offset); + //return std::align(alignment, bytes, pointer, remaining_bytes); blt::gp::operation silly([](float f, int i, bool b) -> float { return static_cast(f); diff --git a/include/blt/gp/program.h b/include/blt/gp/program.h index 225b8d6..8fe1177 100644 --- a/include/blt/gp/program.h +++ b/include/blt/gp/program.h @@ -88,6 +88,7 @@ namespace blt::gp class stack_allocator { constexpr static blt::size_t PAGE_SIZE = 0x1000; + constexpr static blt::size_t MAX_ALIGNMENT = 8; public: /** * Pushes an instance of an object on to the stack