mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-22 02:45:07 -04:00
fs: implement PooledBuffer
This commit is contained in:
parent
50a91b1d6e
commit
496be5ecd4
5 changed files with 521 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue