Skip to content

Commit

Permalink
Lipsticks
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Jun 5, 2022
1 parent 62fbc31 commit b25aab2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ sudo rm -rf /usr/local/share/meevax

| Target Name | Description
|:-------------------|:--
| `all` (default) | Build shared-library `libmeevax.0.4.39.so` and executable `meevax`.
| `all` (default) | Build shared-library `libmeevax.0.4.40.so` and executable `meevax`.
| `test` | Test executable `meevax`.
| `package` | Generate debian package `meevax_0.4.39_amd64.deb`.
| `package` | Generate debian package `meevax_0.4.40_amd64.deb`.
| `install` | Copy files into `/usr/local` __(1)__.
| `install.deb` | `all` + `package` + `sudo apt install <meevax>.deb`
| `safe-install.deb` | `all` + `test` + `package` + `sudo apt install <meevax>.deb`
Expand All @@ -120,7 +120,7 @@ __(1)__ Meevax installed by `make install` cannot be uninstalled by the system's
## Usage

```
Meevax Lisp System, version 0.4.39
Meevax Lisp System, version 0.4.40
Usage: meevax [OPTION...] [FILE...]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.39
0.4.40
16 changes: 3 additions & 13 deletions include/meevax/memory/collector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,8 @@ inline namespace memory

template <typename Pointer>
explicit collectable(Pointer const p)
: context { collector::reset(p, deallocator<Pointer>::deallocate) }
{
if (context)
{
auto const lock = std::unique_lock(resource);
objects.try_emplace(this, context);
}
}
: collectable { collector::reset(p, deallocator<Pointer>::deallocate) }
{}

explicit collectable(region * region)
: context { region }
Expand All @@ -81,11 +75,7 @@ inline namespace memory
template <typename Pointer>
auto reset(Pointer const p) -> void
{
if (context = collector::reset(p, deallocator<Pointer>::deallocate))
{
auto const lock = std::unique_lock(resource);
objects.insert_or_assign(this, context);
}
reset(collector::reset(p, deallocator<Pointer>::deallocate));
}

auto reset(region * region) -> void
Expand Down
13 changes: 3 additions & 10 deletions src/memory/collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,9 @@ inline namespace memory
{
if (not --reference_count)
{
/* ---- NOTE -------------------------------------------------------------
*
* We're using collect instead of clear to check that all objects can be
* collected. If speed is a priority, clear should be used here.
*
* -------------------------------------------------------------------- */

collect();
collect(); // XXX: vector elements
clear();

assert(std::size(regions) == 0);
assert(std::size(objects) == 0);
}
}
Expand Down Expand Up @@ -82,7 +75,7 @@ inline namespace memory
{
assert(*iter);

if (auto region = *iter; region->assigned())
if (auto * const region = *iter; region->assigned())
{
region_allocator.delete_(region);
iter = regions.erase(iter);
Expand Down

0 comments on commit b25aab2

Please sign in to comment.