Commit a8bd0e39 authored by Laszlo Domoszlai's avatar Laszlo Domoszlai
Browse files

inline createF

parent 91d7bddb
......@@ -44,7 +44,8 @@
struct Thunk* create_thunk_app_static(Code* expr, int frame_ptr)
{
Thunk* thunk = createF(((AppEntry*) expr)->f);
Thunk* thunk = (Thunk*) alloc_heap(((AppEntry*) expr)->f->thunk_size);
thunk->desc = ((AppEntry*) expr)->f;
assert(thunk->desc->arity == expr->nr_args);
......@@ -64,7 +65,8 @@ struct Thunk* create_thunk_app_dyn(Code* expr, int frame_ptr)
get_slice(basethunk->desc->type == FT_SLICE ?
((SliceEntry*) basethunk->desc)->forward_ptr : basethunk->desc, basethunk->desc->arity + expr->nr_args);
Thunk* thunk = createF(slice);
Thunk* thunk = (Thunk*) alloc_heap(slice->thunk_size);
thunk->desc = slice;
assert(thunk->desc->arity == basethunk->desc->arity + expr->nr_args);
......
......@@ -52,14 +52,6 @@ struct Thunk* updateF(Thunk* target, Desc* f) {
return thunk;
}
struct Thunk* createF(Desc* f) {
assert(f != NULL);
Thunk* thunk = (Thunk*) alloc_heap(f->thunk_size);
thunk->desc = f;
return thunk;
}
bool is_hnf(Thunk* thunk)
{
return thunk->desc->hnf;
......
......@@ -47,7 +47,6 @@ int readB(Thunk* thunk);
#endif
struct Thunk* updateF(Thunk* target, Desc* f);
struct Thunk* createF(Desc* f);
bool is_hnf(Thunk* thunk);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment