3 ms·
This is extra cute when you realize that such a vector is basically a 2 level array (first level is a static array of likesized pages, which are themselves arra
by delusional 3y ago
This is extra cute when you realize that such a vector is basically a 2 level array (first level is a static array of likesized pages, which are themselves arrays of the likesized items) where the first pointer deref is hardware accelerated. By lazily allocating the pages from the outer array we end up with a dynamically growing array constructed of only statically sized arrays. The tiny tradoff is that our array now statically grows in proportion to its max size (although this will probably be in kernel memory if we are using the page table)