Skip to content

Timing assertion state is header-static, non-thread-safe, and not cross-translation-unit #64

Description

@xross
  • timing state (timing_blocks, head, tail) is static in header, creating one instance per translation unit
  • xassert_timing_start() in one source file cannot match xassert_timing_end() in another
  • duplicated state memory across files
  • mutable shared state is unsynchronized, so concurrent/threaded or multi-core usage can produce incorrect results
  • expected fix direction:
    • Move timing state out of the public header into a single implementation unit (.c/.xc) so there is one shared instance.
    • Guard all timing state mutations/lookups (timing_blocks, head, tail) with the same lock.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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