Skip to content

Incorrect SFTMap initialization / clearing #155

@wenyuzhao

Description

@wenyuzhao

The following two lines of code allocate EmptySpaceSFT in the stack and save the pointer (which points into the stack) to some global storage.

https://github.com/mmtk/mmtk-core/blob/master/src/policy/space.rs#L101
https://github.com/mmtk/mmtk-core/blob/master/src/policy/space.rs#L125

impl SFTMap {
    pub fn new() -> Self {
        SFTMap {
            sft: vec![&EmptySpaceSFT {}; MAX_CHUNKS],
        }
    }
    ...
    pub fn clear(&self, chunk_idx: usize) {
        self.set(chunk_idx, &EmptySpaceSFT {});
    }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions