#gc #rooting #shadowstack

bin+lib gc-shadowstack

Shadow stack algorithm implementation for GC object rooting

3 releases (stable)

1.1.1 Apr 9, 2021
1.0.0 Apr 9, 2021
0.1.0 Apr 9, 2021

#86 in #gc

MIT license

14KB
191 lines

gc-shadowstack

Implementation of shadow stack to implement object rooting in GC libraries.

Description

Unlike many GC algorithms which rely on a cooperative code generator to compile stack maps (no support in rustc), this algorithm carefully maintains a linked list of stack roots [Henderson2002]. This so-called “shadow stack” mirrors the machine stack. Maintaining this data structure is slower than using a stack map compiled into the executable as constant data, but has a significant portability advantage because it requires no special support from the target code generator, and does not require tricky platform-specific code to crawl the machine stack nor it requires heap allocation and reference counting for maintaining rooted object list.


lib.rs:

Shadow stack implementation for rooting in GCs

Description

Unlike other algorithms to take care of rooted objects like use reference counting to take count of instances on stack, this algorithm maintains a singly linked list of stack roots. This so-called "shadow stack" mirrors the machine stack. Maintaining this data is much faster and memory-efficent than using reference-counted stack roots, it does not require heap allocation, and does not rely on compiler optimizations. Dummy module that generates shadow stack type to see documentation of all APIs provided.

Dependencies

~25KB