diff --git a/README.md b/README.md index c286e5b1e..1f0e64f47 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.72_amd64.deb +sudo apt install build/meevax_0.5.73_amd64.deb ``` or @@ -123,9 +123,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.72.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.73.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.72_amd64.deb` +| `package` | Generate debian package `meevax_0.5.73_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index 873f2efa2..ef49227c1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.72 +0.5.73 diff --git a/include/meevax/kernel/pair.hpp b/include/meevax/kernel/pair.hpp index 59dde7cf9..03a5f199d 100644 --- a/include/meevax/kernel/pair.hpp +++ b/include/meevax/kernel/pair.hpp @@ -18,7 +18,7 @@ #define INCLUDED_MEEVAX_KERNEL_PAIR_HPP #include -#include +#include namespace meevax { @@ -26,20 +26,20 @@ inline namespace kernel { struct pair; - using object = heterogeneous_pointer; + using object = gc_pointer; using let = object; let extern unit; template - auto make(Ts&&... xs) + auto make(Ts&&... xs) -> object { return object::allocate(std::forward(xs)...); } template - auto make(T&& x) + auto make(T&& x) -> object { return object::allocate>(std::forward(x)); } diff --git a/include/meevax/memory/gc_pointer.hpp b/include/meevax/memory/gc_pointer.hpp index f377615d2..7b527807d 100644 --- a/include/meevax/memory/gc_pointer.hpp +++ b/include/meevax/memory/gc_pointer.hpp @@ -18,6 +18,7 @@ #define INCLUDED_MEEVAX_MEMORY_GC_POINTER_HPP #include +#include #include namespace meevax @@ -25,21 +26,28 @@ namespace meevax inline namespace memory { template - struct gc_pointer : public nan_boxing_pointer + struct gc_pointer : public heterogeneous_pointer , private collector::registration { - explicit constexpr gc_pointer(std::nullptr_t = nullptr) + using pointer = heterogeneous_pointer; + + gc_pointer(gc_pointer const& gcp) + : pointer { gcp } + , collector::registration { gcp.header } {} template )> explicit gc_pointer(T const& datum) - : nan_boxing_pointer { datum } - , collector::registration { locate(nan_boxing_pointer::get()) } + : pointer { datum } + , collector::registration { locate(pointer::get()) } {} - explicit gc_pointer(gc_pointer const& gcp) - : nan_boxing_pointer { gcp } - , collector::registration { gcp.header } + gc_pointer(pointer const& p) + : pointer { p } + , collector::registration { locate(pointer::get()) } + {} + + gc_pointer(std::nullptr_t = nullptr) {} auto operator =(gc_pointer const& gcp) -> auto & @@ -50,13 +58,13 @@ inline namespace memory auto reset(gc_pointer const& gcp) -> void { - nan_boxing_pointer::reset(gcp); + pointer::reset(gcp); collector::registration::reset(gcp.header); } auto reset(std::nullptr_t = nullptr) -> void { - nan_boxing_pointer::reset(); + pointer::reset(); collector::registration::reset(); } }; diff --git a/include/meevax/memory/heterogeneous_pointer.hpp b/include/meevax/memory/heterogeneous_pointer.hpp index 36d7d6e15..845822e8a 100644 --- a/include/meevax/memory/heterogeneous_pointer.hpp +++ b/include/meevax/memory/heterogeneous_pointer.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include