2019-06-01 23:58:28 +00:00
|
|
|
/*
|
|
|
|
* 4coder app links base allocator
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
2019-10-01 02:06:21 +00:00
|
|
|
Scratch_Block::Scratch_Block(Application_Links *app, Scratch_Share_Code share){
|
|
|
|
scratch_block__init(this, get_thread_context(app), share);
|
2019-06-01 23:58:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Scratch_Block::Scratch_Block(Application_Links *app){
|
2019-10-01 02:06:21 +00:00
|
|
|
scratch_block__init(this, get_thread_context(app), share_code_default);
|
2019-06-01 23:58:28 +00:00
|
|
|
}
|
|
|
|
|
2019-10-01 02:06:21 +00:00
|
|
|
////////////////////////////////
|
2019-06-01 23:58:28 +00:00
|
|
|
|
2019-10-01 02:06:21 +00:00
|
|
|
internal Arena*
|
2019-12-18 03:38:08 +00:00
|
|
|
reserve_arena(Application_Links *app, u64 chunk_size, u64 align){
|
2019-10-01 02:06:21 +00:00
|
|
|
Thread_Context *tctx = get_thread_context(app);
|
|
|
|
return(reserve_arena(tctx, chunk_size, align));
|
2019-06-01 23:58:28 +00:00
|
|
|
}
|
|
|
|
|
2019-10-01 02:06:21 +00:00
|
|
|
internal Arena*
|
2019-12-18 03:38:08 +00:00
|
|
|
reserve_arena(Application_Links *app, u64 chunk_size){
|
2019-10-01 02:06:21 +00:00
|
|
|
Thread_Context *tctx = get_thread_context(app);
|
|
|
|
return(reserve_arena(tctx, chunk_size));
|
2019-06-01 23:58:28 +00:00
|
|
|
}
|
|
|
|
|
2019-10-01 02:06:21 +00:00
|
|
|
internal Arena*
|
|
|
|
reserve_arena(Application_Links *app){
|
|
|
|
Thread_Context *tctx = get_thread_context(app);
|
|
|
|
return(reserve_arena(tctx));
|
2019-06-01 23:58:28 +00:00
|
|
|
}
|
|
|
|
|
2019-10-01 02:06:21 +00:00
|
|
|
internal void
|
|
|
|
release_arena(Application_Links *app, Arena *arena){
|
|
|
|
Thread_Context *tctx = get_thread_context(app);
|
|
|
|
release_arena(tctx, arena);
|
2019-06-01 23:58:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// BOTTOM
|
|
|
|
|