fs: implement PooledBuffer

This commit is contained in:
Michael Scire committed 2020-04-06 03:15:38 -07:00
1 parent 50a91b1d6e
commit 496be5ecd4
5 files changed
+521 -6

No files matched your search

@@ -17,16 +17,11 @@
#pragma once
#include <vapours/common.hpp>
#include <vapours/assert.hpp>
#include <vapours/util/util_bitutil.hpp>
namespace ams::util {
/* Utilities for alignment to power of two. */
template<typename T>
constexpr ALWAYS_INLINE bool IsPowerOfTwo(T value) {
using U = typename std::make_unsigned<T>::type;
return (static_cast<U>(value) & static_cast<U>(value - 1)) == 0;
}
template<typename T>
constexpr ALWAYS_INLINE T AlignUp(T value, size_t alignment) {
using U = typename std::make_unsigned<T>::type;