ekmett / ekmett/thc

Size-parametrised are(n)as

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
17
Forks
0
PR merge metrics
No merged PRs in 30d

Description

More than ten years ago I started working on an idea that would allow shared metadata for a short array of fixed-size objects. (Remnants are here: http://github.com/ggreif/aL4nin).

The idea is to have a c++ (templated) type for GC-ed heap arenas (i.e. fragments of the full GC heap)

``` c++
template
struct Arena
{
static void* getMeta(void*) { ... }
...
};
```

These guys would be allocated with `mmap` such that a sufficient number of least significant bits of the address are zero (e.g. `0x0000007599d30000`). Each arena would be partitioned into a prefix _meta_ and a following _object_ portion. Given a pointer into the latter one can compute a corresponding pointer into the former in a rather cheap manner from the `Anchor` and `Compression` template arguments. (Especially when those are both 2^k.)

Basically one masks away the LSBits corresponding to `Anchor` (obtaining the start of the `Arena`) and divides the offset from the arena to the object by the compression factor to obtain the metadata index. Adding this index to the arena pointer results in the metadata pointer.

In a runtime system many objects can share common meta-data (pvtbl, GC-info etc.) at the cost of some fragmentation in the arenas, because depending on what type of object is to be allocated one needs to keep track of a separate sub-arena which shares the same metadata entries.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the linked aL4nin remnants and then inspect the current thc repository to determine whether an arena implementation already exists. The issue describes a templated C++ arena concept but names no files, tests, or concrete acceptance criteria; completion would require an agreed design and implementation plan.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.