4coder/code/custom/4coder_app_links_allocator.cpp

33 lines
936 B
C++
Raw Permalink Normal View History

2019-06-01 23:58:28 +00:00
/*
* 4coder app links base allocator
*/
// TOP
Scratch_Block::Scratch_Block(Application_Links *app){
2020-03-11 23:22:37 +00:00
Thread_Context *t = this->tctx = get_thread_context(app);
this->arena = tctx_reserve(t);
this->temp = begin_temp(this->arena);
2019-06-01 23:58:28 +00:00
}
2020-03-11 23:22:37 +00:00
Scratch_Block::Scratch_Block(Application_Links *app, Arena *a1){
Thread_Context *t = this->tctx = get_thread_context(app);
this->arena = tctx_reserve(t, a1);
this->temp = begin_temp(this->arena);
2019-06-01 23:58:28 +00:00
}
2020-03-11 23:22:37 +00:00
Scratch_Block::Scratch_Block(Application_Links *app, Arena *a1, Arena *a2){
Thread_Context *t = this->tctx = get_thread_context(app);
this->arena = tctx_reserve(t, a1, a2);
this->temp = begin_temp(this->arena);
2019-06-01 23:58:28 +00:00
}
2020-03-11 23:22:37 +00:00
Scratch_Block::Scratch_Block(Application_Links *app, Arena *a1, Arena *a2, Arena *a3){
Thread_Context *t = this->tctx = get_thread_context(app);
this->arena = tctx_reserve(t, a1, a2, a3);
this->temp = begin_temp(this->arena);
2019-06-01 23:58:28 +00:00
}
// BOTTOM