This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <type_traits> | |
#include <memory> | |
#include <cstdint> | |
// Simple arena implementation. A linked-list of large stacks of bytes | |
class Allocator | |
{ | |
public: | |
Allocator() { Clear(); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am hodgman on github. | |
* I am hodgman (https://keybase.io/hodgman) on keybase. | |
* I have a public key ASD8s5F5jUhkVA9lEgas77I0NwA2cdHb1tNfrK8s1WCb0Ao | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HashMap { | |
constexpr NumBuckets = Length * Factor; | |
struct N { | |
K key; | |
N* next; | |
}; | |
N nodes[Length]; | |
V values[Length]; | |
N* freeList; | |
N* buckets[NumBuckets]; |