Skip to content

Commit efd3dc4

Browse files
authored
More dynamic memory allocation (#110)
Fixes #107 + implement dynamic growing string_table + implement dynamic growing output Fixes #102 + implement state function to get current usage and capacity of structured limits defined in config.h Fixes #111 + store container offsets relative to story instruction start Fixes #104 + Check and adopt for compilation with C++17
1 parent 1dd0fa9 commit efd3dc4

33 files changed

Lines changed: 1655 additions & 1307 deletions

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,4 @@ ReflowComments: true
110110
RemoveBracesLLVM: false
111111
UseCRLF: false
112112
DeriveLineEnding: false
113+
LineEnding: LF

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ mark_as_advanced(PYBIND11_USE_CROSSCOMPILING)
4141
enable_testing()
4242

4343
# Project setup
44-
project(inkcpp VERSION 0.1.8)
45-
SET(CMAKE_CXX_STANDARD 20)
44+
project(inkcpp VERSION 0.1.9)
45+
SET(CMAKE_CXX_STANDARD 17)
4646
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
4747
SET(CMAKE_INSTALL_LIBRARY_DIR lib)
4848
SET(CMAKE_INSTALL_INCLUDE_DIR include)

Documentation/cmake_example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ find_package(inkcpp CONFIG REQUIRED)
55

66
# for CXX builds
77
add_executable(main_cpp main.cpp)
8-
set_property(TARGET main_cpp PROPERTY CXX_STANDARD 20)
8+
set_property(TARGET main_cpp PROPERTY CXX_STANDARD 17)
99
target_link_libraries(main_cpp inkcpp inkcpp_compiler)
1010

1111
# for C builds

inkcpp/array.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
#pragma once
88

9+
#include "config.h"
910
#include "snapshot_interface.h"
1011
#include "system.h"
1112
#include "traits.h"
@@ -28,6 +29,11 @@ class managed_array : public snapshot_interface
2829
}
2930
}
3031

32+
config::statistics::container statistics() const
33+
{
34+
return {static_cast<int>(_capacity), static_cast<int>(_size)};
35+
}
36+
3137
virtual ~managed_array()
3238
{
3339
if constexpr (dynamic) {

0 commit comments

Comments
 (0)