Skip to content

Commit

Permalink
Try adding alignas(8) to force correct alignment and work around GC…
Browse files Browse the repository at this point in the history
…C bug
  • Loading branch information
NHDaly committed Nov 21, 2024
1 parent af1bf51 commit 5b58e04
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -2295,14 +2295,15 @@ typedef struct _jl_task_t {
uint16_t priority;
// flag indicating whether or not to record timing metrics for this task
uint8_t metrics_enabled;
// (alignas(8) is needed in the following fields to work around a GCC bug. See #56626.)
// timestamp this task first entered the run queue
_Atomic(uint64_t) first_enqueued_at;
alignas(8) _Atomic(uint64_t) first_enqueued_at;
// timestamp this task was most recently scheduled to run
_Atomic(uint64_t) last_started_running_at;
alignas(8) _Atomic(uint64_t) last_started_running_at;
// time this task has spent running; updated when it yields or finishes.
_Atomic(uint64_t) cpu_time_ns;
alignas(8) _Atomic(uint64_t) cpu_time_ns;
// timestamp this task finished (i.e. entered state DONE or FAILED).
_Atomic(uint64_t) finished_at;
alignas(8) _Atomic(uint64_t) finished_at;

// hidden state:
// cached floating point environment
Expand Down

0 comments on commit 5b58e04

Please sign in to comment.