From 67f1a5d15d9cb3814251dd6569fd7c977826742f Mon Sep 17 00:00:00 2001 From: yamacir-kit Date: Tue, 20 Feb 2024 00:42:23 +0900 Subject: [PATCH 01/40] Cleanup `pair` type constructor Signed-off-by: yamacir-kit --- README.md | 6 +++--- VERSION | 2 +- include/meevax/kernel/pair.hpp | 13 +++++++------ include/meevax/memory/collector.hpp | 8 +++++--- src/kernel/pair.cpp | 8 -------- 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 6a483660c..d4afe7081 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Procedures for each standard are provided by the following R7RS-style libraries: cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.5.119_amd64.deb +sudo apt install build/meevax_0.5.120_amd64.deb ``` or @@ -123,9 +123,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.119.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.120.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.119_amd64.deb` +| `package` | Generate debian package `meevax_0.5.120_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index e8b2b30cf..0a7839ea8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.119 +0.5.120 diff --git a/include/meevax/kernel/pair.hpp b/include/meevax/kernel/pair.hpp index a5b02366f..cecb4ae84 100644 --- a/include/meevax/kernel/pair.hpp +++ b/include/meevax/kernel/pair.hpp @@ -138,13 +138,14 @@ inline namespace kernel constexpr pair() = default; - explicit pair(object const&); - - explicit pair(object const&, object const&); + template , T, U>)> + explicit pair(T&& x, U&& y = unit) + : std::pair { std::forward(x), std::forward(y) } + {} - template > - explicit pair(object const& a, Ts&&... xs) - : pair { a, make(std::forward(xs)...) } + template > + explicit pair(T&& x, Ts&&... xs) + : std::pair { std::forward(x), make(std::forward(xs)...) } {} virtual ~pair() = default; diff --git a/include/meevax/memory/collector.hpp b/include/meevax/memory/collector.hpp index 0c9675431..075fe5703 100644 --- a/include/meevax/memory/collector.hpp +++ b/include/meevax/memory/collector.hpp @@ -18,10 +18,12 @@ #define INCLUDED_MEEVAX_MEMORY_COLLECTOR_HPP #include +#include +#include #include #include -#include +#include namespace meevax { @@ -181,9 +183,9 @@ inline namespace memory protected: static inline tag * cache = nullptr; - static inline v2::pointer_set tags {}; + static inline integer_set tags {}; - static inline v2::pointer_set mutators {}; + static inline integer_set mutators {}; static inline std::size_t allocation = 0; diff --git a/src/kernel/pair.cpp b/src/kernel/pair.cpp index 3d8ca0305..2a23c408d 100644 --- a/src/kernel/pair.cpp +++ b/src/kernel/pair.cpp @@ -22,14 +22,6 @@ inline namespace kernel { let unit { nullptr }; - pair::pair(object const& a) - : std::pair { a, unit } - {} - - pair::pair(object const& a, object const& b) - : std::pair { a, b } - {} - auto pair::compare(pair const* that) const -> bool { return that and *this == *that; From 3c206cdc133742e723fd58eebb5079ac7e322679 Mon Sep 17 00:00:00 2001 From: yamacir-kit Date: Tue, 20 Feb 2024 02:37:11 +0900 Subject: [PATCH 02/40] Remove `format.cpp` Signed-off-by: yamacir-kit --- README.md | 6 +++--- VERSION | 2 +- include/meevax/memory/collector.hpp | 1 + src/format.cpp | 29 ----------------------------- 4 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 src/format.cpp diff --git a/README.md b/README.md index d4afe7081..3f7af7d0a 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Procedures for each standard are provided by the following R7RS-style libraries: cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.5.120_amd64.deb +sudo apt install build/meevax_0.5.121_amd64.deb ``` or @@ -123,9 +123,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.120.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.121.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.120_amd64.deb` +| `package` | Generate debian package `meevax_0.5.121_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index 0a7839ea8..39a32b845 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.120 +0.5.121 diff --git a/include/meevax/memory/collector.hpp b/include/meevax/memory/collector.hpp index 075fe5703..0906c3b85 100644 --- a/include/meevax/memory/collector.hpp +++ b/include/meevax/memory/collector.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include diff --git a/src/format.cpp b/src/format.cpp deleted file mode 100644 index 583dcf8f6..000000000 --- a/src/format.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright 2018-2023 Tatsuya Yamasaki. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include - -auto main(int const, char const* const* const argv) -> int -{ - using namespace meevax; - - for (let const& x : input_file_port(argv[1])) - { - std::cout << x << std::flush; - } - - return EXIT_SUCCESS; -} From c6163ff1fdfffa9badc6f064764a6625c1a7e7ae Mon Sep 17 00:00:00 2001 From: yamacir-kit Date: Sun, 25 Feb 2024 00:46:20 +0900 Subject: [PATCH 03/40] Update frequently `make`ed types to allocate memory from memory pool Signed-off-by: yamacir-kit --- README.md | 6 +++--- VERSION | 2 +- include/meevax/kernel/dynamic_environment.hpp | 4 ++-- include/meevax/kernel/pair.hpp | 14 +++++--------- include/meevax/kernel/syntactic_environment.hpp | 2 +- include/meevax/memory/collector.hpp | 4 ++-- include/meevax/memory/heterogeneous_pointer.hpp | 2 +- include/meevax/memory/simple_allocator.hpp | 2 ++ src/kernel/boot.cpp | 2 +- 9 files changed, 18 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 3f7af7d0a..eb66971f5 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Procedures for each standard are provided by the following R7RS-style libraries: cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.5.121_amd64.deb +sudo apt install build/meevax_0.5.122_amd64.deb ``` or @@ -123,9 +123,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.121.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.122.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.121_amd64.deb` +| `package` | Generate debian package `meevax_0.5.122_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index 39a32b845..71b3d8fc7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.121 +0.5.122 diff --git a/include/meevax/kernel/dynamic_environment.hpp b/include/meevax/kernel/dynamic_environment.hpp index 78c15301c..2ca3664f2 100644 --- a/include/meevax/kernel/dynamic_environment.hpp +++ b/include/meevax/kernel/dynamic_environment.hpp @@ -214,7 +214,7 @@ inline namespace kernel * where = (c' . e) * * ----------------------------------------------------------------- */ - s = cons(make(cadr(c), e), s); + s = cons(make>(cadr(c), e), s); c = cddr(c); goto fetch; @@ -225,7 +225,7 @@ inline namespace kernel * where = (s e c' . d) * * ----------------------------------------------------------------- */ - s = cons(list(make(s, e, cadr(c), d)), s); + s = cons(list(make>(s, cons(e, cons(cadr(c), d)))), s); c = cddr(c); goto fetch; diff --git a/include/meevax/kernel/pair.hpp b/include/meevax/kernel/pair.hpp index cecb4ae84..043c39533 100644 --- a/include/meevax/kernel/pair.hpp +++ b/include/meevax/kernel/pair.hpp @@ -20,6 +20,7 @@ #include #include #include +#include namespace meevax { @@ -43,14 +44,14 @@ inline namespace kernel typename... Ts> auto make(Ts&&... xs) -> object { - return object::allocate(std::forward(xs)...); + return object::make(std::forward(xs)...); } template > auto make(T&& x) -> object { - return object::allocate, Allocator>(std::forward(x)); + return object::make, Allocator>(std::forward(x)); } template