diff options
author | Syoyo Fujita <syoyo@lighttransport.com> | 2017-07-05 16:32:40 +0900 |
---|---|---|
committer | Syoyo Fujita <syoyo@lighttransport.com> | 2017-07-05 16:32:40 +0900 |
commit | 95fba2ab323d69aab94aee01e0594d2a899fe722 (patch) | |
tree | 1765729cc515f5eabf4b5d557ac94c2b92dcd3c9 /experimental/lfpAlloc/Utils.hpp | |
parent | 99518b6d3e7c624d97e5e4791efcc96755c65d44 (diff) | |
download | tinyobjloader-95fba2ab323d69aab94aee01e0594d2a899fe722.tar.gz |
Changed to use lfpAlloc from ltalloc for experimental multi-threaded .obj parser since ltalloc is not a porable(e.g. it does not support ARM archtecture).
Diffstat (limited to 'experimental/lfpAlloc/Utils.hpp')
-rw-r--r-- | experimental/lfpAlloc/Utils.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/experimental/lfpAlloc/Utils.hpp b/experimental/lfpAlloc/Utils.hpp new file mode 100644 index 0000000..8740a79 --- /dev/null +++ b/experimental/lfpAlloc/Utils.hpp @@ -0,0 +1,20 @@ +#include <cstdint> + +namespace lfpAlloc { +namespace detail { +template <std::size_t Val, std::size_t base = 2> +struct Log { + enum { value = 1 + Log<Val / base, base>::value }; +}; + +template <std::size_t base> +struct Log<1, base> { + enum { value = 0 }; +}; + +template <std::size_t base> +struct Log<0, base> { + enum { value = 0 }; +}; +} +} |