speed up booting by implementing realloc+padovan

This commit is contained in:
Krasimir Angelov
2022-02-09 10:36:42 +01:00
parent fdd33b63d9
commit 8960e00e26
7 changed files with 159 additions and 11 deletions

View File

@@ -85,6 +85,11 @@ public:
return current_db->malloc_internal(sizeof(A)+extra_bytes);
}
template<class A>
static ref<A> realloc(ref<A> r, size_t extra_bytes) {
return current_db->realloc_internal(r.as_object(), sizeof(A)+extra_bytes);
}
template<class A>
static void free(ref<A> o) {
current_db->free_internal(o.as_object());
@@ -111,6 +116,8 @@ private:
PGF_INTERNAL_DECL void init_state(size_t size);
PGF_INTERNAL_DECL object malloc_internal(size_t bytes);
PGF_INTERNAL_DECL object realloc_internal(object oldo, size_t bytes);
PGF_INTERNAL_DECL void free_internal(object o);
PGF_INTERNAL_DECL void register_process();