Skip to content

Commit

Permalink
Safer way of allocating task memory.
Browse files Browse the repository at this point in the history
  • Loading branch information
yebai committed Jul 24, 2017
1 parent 07966fa commit 42d4ca6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions deps/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ jl_task_t *jl_clone_task(jl_task_t *t)
{
jl_ptls_t ptls = jl_get_ptls_states();
//jl_task_t *newt = (jl_task_t*)jl_gc_alloc(ptls, sizeof(jl_task_t),
// jl_task_type);
jl_task_t *newt = (jl_task_t*)jl_gc_allocobj(sizeof(jl_task_t));
// jl_task_type); // jl_gc_alloc is not exported.
//jl_task_t *newt = (jl_task_t*)jl_gc_allocobj(sizeof(jl_task_t)); // implementation a.
jl_task_t *newt = (jl_task_t*)jl_new_task(t->start, t->ssize); // Not efficient as a.
memset(newt, 0, sizeof(jl_task_t));
jl_set_typeof(newt, jl_task_type);
newt->stkbuf = NULL;
Expand Down

0 comments on commit 42d4ca6

Please sign in to comment.