libstrat: fix compilation without pre-compiled header/without lto

This commit is contained in:
Michael Scire 2021-10-06 17:58:42 -07:00
parent 7ca83c9d3b
commit e8f1efd01b
37 changed files with 89 additions and 33 deletions

View file

@ -176,6 +176,7 @@ namespace ams::sf::hipc {
virtual Server *AllocateServer() = 0;
virtual void DestroyServer(Server *server) = 0;
virtual Result OnNeedsToAccept(int port_index, Server *server) {
AMS_UNUSED(port_index, server);
AMS_ABORT("OnNeedsToAccept must be overridden when using indexed ports");
}

View file

@ -173,6 +173,7 @@ namespace ams::sf::hipc {
virtual ServerSessionManager *GetSessionManagerByTag(u32 tag) {
/* This is unused. */
AMS_UNUSED(tag);
return this;
}
};

View file

@ -790,6 +790,7 @@ namespace ams::sf::impl {
virtual Result GetInObjects(cmif::ServiceObjectHolder *in_objects) const override final {
/* By default, InObjects aren't supported. */
AMS_UNUSED(in_objects);
return sf::ResultNotSupported();
}
};

View file

@ -31,7 +31,7 @@ namespace ams::sf {
}
void Detach() {
this->_handle = 0;
this->_handle = {};
}
void *Allocate(size_t size) {
@ -42,6 +42,8 @@ namespace ams::sf {
}
void Deallocate(void *ptr, size_t size) {
AMS_UNUSED(size);
os::LockSdkMutex(std::addressof(this->_mutex));
lmem::FreeToExpHeap(this->_handle, ptr);
os::UnlockSdkMutex(std::addressof(this->_mutex));

View file

@ -39,6 +39,7 @@ namespace ams::sf {
}
virtual void DeallocateImpl(void *buffer, size_t size, size_t alignment) override {
AMS_UNUSED(size, alignment);
return lmem::FreeToExpHeap(this->handle, buffer);
}
@ -64,10 +65,14 @@ namespace ams::sf {
virtual void *AllocateImpl(size_t size, size_t alignment) override {
AMS_ASSERT(size <= lmem::GetUnitHeapUnitSize(this->handle));
AMS_ASSERT(alignment <= static_cast<size_t>(lmem::GetUnitHeapAlignment(this->handle)));
AMS_UNUSED(size, alignment);
return lmem::AllocateFromUnitHeap(this->handle);
}
virtual void DeallocateImpl(void *buffer, size_t size, size_t alignment) override {
AMS_UNUSED(size, alignment);
return lmem::FreeToUnitHeap(this->handle, buffer);
}

View file

@ -33,6 +33,7 @@ namespace ams::sf {
}
virtual void DeallocateImpl(void *buffer, size_t size, size_t alignment) override {
AMS_UNUSED(size, alignment);
return this->standard_allocator->Free(buffer);
}