Skip to content
Snippets Groups Projects
Commit acf2d7a4 authored by despair's avatar despair
Browse files

moved all local types, allocators, and functors to `namespace ntr`

parent 0e032244
No related branches found
No related tags found
No related merge requests found
......@@ -12,15 +12,17 @@
#include <cstdint>
// let's try fast strings
typedef std::basic_string<char, std::char_traits<char>, ntr::TLSFAlloc<char>> fast_string;
namespace ntr{ size_t string_hash(const fast_string &str); bool fast_string_compare(fast_string t1, fast_string t2); }
typedef std::unordered_map<fast_string,fast_string,std::function<decltype(ntr::string_hash)>,std::function<decltype(ntr::fast_string_compare)>,ntr::TLSFAlloc<std::pair<const fast_string, fast_string>>> stringmap;
namespace ntr{
typedef std::basic_string<char, std::char_traits<char>, TLSFAlloc<char>> fast_string;
size_t string_hash(const fast_string &str);
bool fast_string_compare(fast_string t1, fast_string t2);
typedef std::unordered_map<fast_string,fast_string,std::function<decltype(ntr::string_hash)>,std::function<decltype(ntr::fast_string_compare)>,ntr::TLSFAlloc<std::pair<const fast_string, fast_string>>> stringmap;
}
// Class which holds the parsed configuration options after
// being processed by CFGFileParser. No longer a "trivial class"
// just select by cfg->GlobalSettings....
struct BrowserConfiguration{
stringmap GlobalSettings;
ntr::stringmap GlobalSettings;
// fast allocation!
static void* operator new(std::size_t n){
if (void *mem = tlsf_malloc(n)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment