Skip to content

Instantly share code, notes, and snippets.

@ChrisLundquist
Created September 14, 2012 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisLundquist/3721142 to your computer and use it in GitHub Desktop.
Save ChrisLundquist/3721142 to your computer and use it in GitHub Desktop.
Proof of concept for Page allocator
#include <iostream>
template <int size> class Page{
char bytes[size];
};
int main(void) {
Page<10> p1;
Page<200> p2;
std::cout << "Size p1: " << sizeof(p1) << std::endl; // Size p1: 10
std::cout << "Size p2: " << sizeof(p2) << std::endl; // Size p2: 200
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment