Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make Task smaller by rearranging fields #41351

Merged
merged 1 commit into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2539,13 +2539,13 @@ void jl_init_types(void) JL_GC_DISABLED
"result",
"logstate",
"code",
"_state",
"sticky",
"_isexception",
"rngState0",
"rngState1",
"rngState2",
"rngState3"),
"rngState3",
"_state",
"sticky",
"_isexception"),
jl_svec(14,
jl_any_type,
jl_any_type,
Expand All @@ -2554,13 +2554,13 @@ void jl_init_types(void) JL_GC_DISABLED
jl_any_type,
jl_any_type,
jl_any_type,
jl_uint8_type,
jl_bool_type,
jl_bool_type,
jl_uint64_type,
jl_uint64_type,
jl_uint64_type,
jl_uint64_type),
jl_uint64_type,
jl_uint8_type,
jl_bool_type,
jl_bool_type),
jl_emptysvec,
0, 1, 6);
jl_value_t *listt = jl_new_struct(jl_uniontype_type, jl_task_type, jl_nothing_type);
Expand Down
14 changes: 7 additions & 7 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -1829,24 +1829,24 @@ typedef struct _jl_task_t {
jl_value_t *result;
jl_value_t *logstate;
jl_function_t *start;
uint8_t _state;
uint8_t sticky; // record whether this Task can be migrated to a new thread
uint8_t _isexception; // set if `result` is an exception to throw or that we exited with
uint64_t rngState0; // really rngState[4], but more convenient to split
uint64_t rngState1;
uint64_t rngState2;
uint64_t rngState3;
uint8_t _state;
uint8_t sticky; // record whether this Task can be migrated to a new thread
uint8_t _isexception; // set if `result` is an exception to throw or that we exited with

// hidden state:
// id of owning thread - does not need to be defined until the task runs
int16_t tid;
// multiqueue priority
int16_t prio;
// saved gc stack top for context switches
jl_gcframe_t *gcstack;
size_t world_age;
// quick lookup for current ptls
jl_tls_states_t *ptls; // == jl_all_tls_states[tid]
// id of owning thread - does not need to be defined until the task runs
int16_t tid;
// multiqueue priority
int16_t prio;
// saved exception stack
jl_excstack_t *excstack;
// current exception handler
Expand Down