mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2026-09-25 12:22:14 -05:00
- use const auto& where possible
- avoid using const std::unique_ptr& and const std::shared_ptr& - avoid wrapping results in std::optional - prefer std::string_view over const std::string& - update FSUtils::LoadFileToMem to write into std::vector<uint8_t> - use std::span when possible - Avoid unnessecary copies in PluginDataFactory - allocate plugins as HeapMemoryFixedSize which bascially is a std::unique_ptr with fixed size
This commit is contained in:
@@ -24,31 +24,31 @@ class FunctionSymbolData {
|
||||
public:
|
||||
FunctionSymbolData(const FunctionSymbolData &o2) = default;
|
||||
|
||||
FunctionSymbolData(std::string &name, void *address, uint32_t size) : name(name),
|
||||
address(address),
|
||||
size(size) {
|
||||
FunctionSymbolData(std::string_view name, void *address, uint32_t size) : mName(name),
|
||||
mAddress(address),
|
||||
mSize(size) {
|
||||
}
|
||||
|
||||
bool operator<(const FunctionSymbolData &rhs) const {
|
||||
return (uint32_t) address < (uint32_t) rhs.address;
|
||||
return (uint32_t) mAddress < (uint32_t) rhs.mAddress;
|
||||
}
|
||||
|
||||
virtual ~FunctionSymbolData() = default;
|
||||
|
||||
[[nodiscard]] const std::string &getName() const {
|
||||
return name;
|
||||
return mName;
|
||||
}
|
||||
|
||||
[[nodiscard]] void *getAddress() const {
|
||||
return address;
|
||||
return mAddress;
|
||||
}
|
||||
|
||||
[[nodiscard]] uint32_t getSize() const {
|
||||
return size;
|
||||
return mSize;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string name;
|
||||
void *address;
|
||||
uint32_t size;
|
||||
std::string mName;
|
||||
void *mAddress;
|
||||
uint32_t mSize;
|
||||
};
|
||||
Reference in New Issue
Block a user