bytevectors containing both references and data?

Open
#1,101 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
12/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Domain
compilers

Research direction

The issue asks whether a bytevector can mark a region as holding GC-tracked pointers, using bytevector-reference-set! alongside the bytevector-ieee-double-native-set! and bytevector-s64-native-set! accessors. Start by reading how reference bytevectors are represented and traced by the collector, then check whether a mixed layout is already possible. Done means a written design decision or maintainer answer on mixed-region support, not a patch.

Written by the indexing model from the issue text.

Description

It's my understanding that with reference bytevectors, we can treat them as arrays of pointers to scheme objects such that when one of those scheme objects are moved, the pointers in the reference bytevector are updated. Is it possible to mark a specific region in a bytevector as a pointer?

For example:

(define obj-parent (make-bytevector 16))
(define obj-child (make-bytevector 8))

(bytevector-reference-set! obj-parent 0 obj-child)
(bytevector-ieee-double-native-set! obj-parent 8 3.14)

(bytevector-s64-native-set! obj-child 0 42)

Real world use case is SDL_GPUVertexInputState.

It's not really a problem but it would be convenient if the GC could help manage these structures.

Dominant language
Scheme
Stars
7.4k
Forks
1k
Avg merge
1d 20h
Merged PRs (30d)
19

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cisco/ChezScheme

All issues in cisco/ChezScheme

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.