/mmtk-liballocs

Some proof-of-concept integrations of MMTk and liballocs

Primary LanguageRust

This repository houses multiple demonstrations of MMTk integrated with liballocs,
in different ways.

It includes the following examples.

- malloc-trivial: an ultra-stupid no-free malloc implementation built with MMTk
  - as a preloadable .so
  - if we also preload liballocs, the usual liballocs queries are supported:
    1. initially we use the generic malloc handling
    2. next (TODO) we use the VO bits feature of MMTk instead of the generic index
    3. also  TODO: can we add a simple free list and free() implementation?
      - broaches the issue of explicit free() in MMTk... how does the mimalloc do this?
        Kunal tells me "sweep does free"

(hypothesised / ongoing):

- unixvm: a VMBinding that uses liballocs for root-finding and object-scanning
  - again exposing malloc as with malloc-trivial, but now re-using
       the mimalloc-style sweep-using-free GC implementation
  - it is not conservative about scanning the stack, so this is expected
       to crash until/unless the available stack frame info is precise
  - i.e. consider this a "straw person"

- allocstrait: demo of extending the VMBinding trait to include also the facilities
    needed for liballocs-queryability of the bound heap implementation,
    with the necessary plumbing on the liballocs side
    and also
    a running VM demo (use Ruby?)
    -- to answer a liballocs query, our default implementation will
       -- use VO bits to recover the object base
       -- use binding-supplied routines to get the type, size, and site if available
       -- ideally also integrate some notion of lifetime policy, but that comes later
    do we also want to extend liballocs's base and meta-level APIs
       to embrace all the properties MMTk exposes (at least pinnedness)?

- mmtk-rebase
    demo of MMTk acting as a client of liballocs for its platform-level services
    e.g. mmapping, SFT map, ...