kern: further codegen tweaks

This commit is contained in:
Michael Scire 2021-01-08 02:35:29 -08:00
parent 4aa18b06e8
commit 1e643f7ab0
7 changed files with 35 additions and 35 deletions

View file

@ -375,8 +375,8 @@ namespace ams::svc::ipc {
u32 *buffer;
size_t size;
public:
constexpr MessageBuffer(u32 *b, size_t sz) : buffer(b), size(sz) { /* ... */ }
constexpr explicit MessageBuffer(u32 *b) : buffer(b), size(sizeof(::ams::svc::ThreadLocalRegion::message_buffer)) { /* ... */ }
constexpr ALWAYS_INLINE MessageBuffer(u32 *b, size_t sz) : buffer(b), size(sz) { /* ... */ }
constexpr explicit ALWAYS_INLINE MessageBuffer(u32 *b) : buffer(b), size(sizeof(::ams::svc::ThreadLocalRegion::message_buffer)) { /* ... */ }
constexpr ALWAYS_INLINE size_t GetBufferSize() const {
return this->size;

View file

@ -39,7 +39,7 @@ namespace ams::util {
IntrusiveListNode *prev;
IntrusiveListNode *next;
public:
constexpr IntrusiveListNode() : prev(this), next(this) { /* ... */ }
constexpr ALWAYS_INLINE IntrusiveListNode() : prev(this), next(this) { /* ... */ }
constexpr ALWAYS_INLINE bool IsLinked() const {
return this->next != this;

View file

@ -41,7 +41,7 @@ namespace ams::util {
template<class, class, class>
friend class IntrusiveRedBlackTree;
public:
constexpr IntrusiveRedBlackTreeNode() : entry() { /* ... */}
constexpr ALWAYS_INLINE IntrusiveRedBlackTreeNode() : entry() { /* ... */}
};
static_assert(std::is_literal_type<IntrusiveRedBlackTreeNode>::value);
@ -355,11 +355,11 @@ namespace ams::util {
/* Generate static implementations for comparison operations for IntrusiveRedBlackTreeRoot. */
RB_GENERATE_WITH_COMPARE_STATIC(IntrusiveRedBlackTreeRootWithCompare, IntrusiveRedBlackTreeNode, entry, CompareImpl, LightCompareImpl);
private:
static int CompareImpl(const IntrusiveRedBlackTreeNode *lhs, const IntrusiveRedBlackTreeNode *rhs) {
static ALWAYS_INLINE int CompareImpl(const IntrusiveRedBlackTreeNode *lhs, const IntrusiveRedBlackTreeNode *rhs) {
return Comparator::Compare(*Traits::GetParent(lhs), *Traits::GetParent(rhs));
}
static int LightCompareImpl(const void *elm, const IntrusiveRedBlackTreeNode *rhs) {
static ALWAYS_INLINE int LightCompareImpl(const void *elm, const IntrusiveRedBlackTreeNode *rhs) {
return Comparator::Compare(*static_cast<const_light_pointer>(elm), *Traits::GetParent(rhs));
}