Skip to content

more optimized and correct management of 8-bit PC counters #20994

@andrewrk

Description

@andrewrk

Extracted from #20958.

529df8c cheated a little bit because it reads up to 7 bytes past the end of the 8-bit counters PC array. It's probably harmless to do because those 7 bytes are very likely mapped and won't be actually used for anything. But it's still better to not access outside that range. Too bad LLVM does not guarantee zero-padding there, it would have been convenient.

Anyway this issue is to stop using .ptr to bypass slice safety here, as well as to make two optimizations:

  • Upgrade from u8 to usize element types. Should be roughly 8x faster to iterate over the array in various places. Be careful because the WebAssembly build will need to know what usize corresponds to in the fuzzed process and match it.
  • Move the covered PC bits to after the header so it goes on the same page with the other rapidly changing memory (the header stats). Right now the PC bits are after the list of PCs which is long.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.fuzzingoptimization

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions