benohalloran / ipa

Speculative malloc with arbitrary heap growth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optimize header allocations

benohalloran opened this issue · comments

Since the headers linked list never removes a header page and new header pages are only ever added to the front of the structure, we can keep track of the first page visited on each loop. When we need to allocate a new header page, the first page we check can be stored locally (simpler). When iterating over header pages, we can check if the current page matches this cache. When we get a match, we can break out of the loop and immediately know that we need to allocate a new header page.

Additionally, when allocating a header page we can immediately allocate a header for use by the process that called the function.

Note complications in #6