mmtk-core icon indicating copy to clipboard operation
mmtk-core copied to clipboard

BarrierSelector #[repr(u8)]

Open wenyuzhao opened this issue 3 years ago • 1 comments

https://github.com/mmtk/mmtk-core/blob/master/src/plan/barriers.rs#L22

Should BarrierSelector be decorated with #[repr(u8)] to safely convert to unique u8 values?

wenyuzhao avatar Feb 02 '22 00:02 wenyuzhao

Yes. We should. If we have more than 256 variants in the enum, the casting to u8 will wrap around.

qinsoon avatar Feb 02 '22 03:02 qinsoon