Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory-mapped files as allocation graphs #88

Open
stephenrkell opened this issue Mar 5, 2024 · 1 comment
Open

Memory-mapped files as allocation graphs #88

stephenrkell opened this issue Mar 5, 2024 · 1 comment

Comments

@stephenrkell
Copy link
Owner

stephenrkell commented Mar 5, 2024

In examples/ for some time now I've had a part-done demo allocator that understands memory-mapped ELF files, as an example of a memory-mappable file format.

This has a few interesting components.

  • abstractions for positions in the allocation tree, and paths through the allocation tree, i.e. conveying strictly more information than a void*
  • a generalised notion of pointers, e.g. capturing how ELF offsets are an encoding of "pointers" to other parts of the file
  • a notion of "interpreter" used to give sense to these generalised pointers: they are "names" that need interpreting
  • a generic traversal routine of the allocation tree or subtrees of it
  • a generic printer of an allocation subtree, aspiring to print editable assembly source code that, when assembled, reproduces the subtree's memory contents byte-for-byte (but encoding "names" or "pointers" or "references" using assembly references)
  • a slightly less generic printer which tries to print each part of the subtree in the most appropriate assembly notation -- e.g. if the data being printed represents instructions in the assembler's native instruction set, it should be printed as instruction syntax

This is mostly a "me thing" for the time being, but I may dump thoughts here.

@stephenrkell
Copy link
Owner Author

If I recall, the place where I paused the ELFy work was one where I needed to implement pointer inversion, i.e. a pre-pass to collect pointer targets, such that I could later ask "what points here?". There was a question of whether bigalloc-level support for this is useful (link to #51 also).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant