Skip to content

More dynamic memory allocation #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
May 13, 2025
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,4 @@ ReflowComments: true
RemoveBracesLLVM: false
UseCRLF: false
DeriveLineEnding: false
LineEnding: LF
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ mark_as_advanced(PYBIND11_USE_CROSSCOMPILING)
enable_testing()

# Project setup
project(inkcpp VERSION 0.1.8)
SET(CMAKE_CXX_STANDARD 20)
project(inkcpp VERSION 0.1.9)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_INSTALL_LIBRARY_DIR lib)
SET(CMAKE_INSTALL_INCLUDE_DIR include)
Expand Down
2 changes: 1 addition & 1 deletion Documentation/cmake_example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(inkcpp CONFIG REQUIRED)

# for CXX builds
add_executable(main_cpp main.cpp)
set_property(TARGET main_cpp PROPERTY CXX_STANDARD 20)
set_property(TARGET main_cpp PROPERTY CXX_STANDARD 17)
target_link_libraries(main_cpp inkcpp inkcpp_compiler)

# for C builds
Expand Down
6 changes: 6 additions & 0 deletions inkcpp/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
#pragma once

#include "config.h"
#include "snapshot_interface.h"
#include "system.h"
#include "traits.h"
Expand All @@ -28,6 +29,11 @@ class managed_array : public snapshot_interface
}
}

config::statistics::container statistics() const
{
return {static_cast<int>(_capacity), static_cast<int>(_size)};
}

virtual ~managed_array()
{
if constexpr (dynamic) {
Expand Down
Loading