Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Warnings] Remove unnecessary member variables to save some memory #1793

Merged
merged 16 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Source/Thunder/PluginServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,6 @@ namespace PluginHost {
ControlData(const uint32_t maxRequests)
: _isExtended(false)
, _maxRequests(maxRequests)
, _state(0)
, _major(~0)
, _minor(~0)
, _patch(~0)
Expand Down Expand Up @@ -753,7 +752,6 @@ namespace PluginHost {
private:
bool _isExtended;
uint32_t _maxRequests;
VARIABLE_IS_NOT_USED uint8_t _state;
uint8_t _major;
uint8_t _minor;
uint8_t _patch;
Expand Down Expand Up @@ -803,9 +801,8 @@ namespace PluginHost {
Service& operator=(Service&&) = delete;
Service& operator=(const Service&) = delete;

Service(const PluginHost::Config& server, const Plugin::Config& plugin, ServiceMap& administrator, const mode type, const Core::ProxyType<RPC::InvokeServer>& handler)
Service(const PluginHost::Config& server, const Plugin::Config& plugin, ServiceMap& administrator, const mode /* type */, const Core::ProxyType<RPC::InvokeServer>& handler)
: PluginHost::Service(plugin, server.WebPrefix(), server.PersistentPath(), server.DataPath(), server.VolatilePath())
, _mode(type)
, _pluginHandling()
, _handler(nullptr)
, _extended(nullptr)
Expand Down Expand Up @@ -1626,7 +1623,6 @@ namespace PluginHost {
}

private:
VARIABLE_IS_NOT_USED const mode _mode;
mutable Core::CriticalSection _pluginHandling;

// The handlers that implement the actual logic behind the service
Expand All @@ -1646,7 +1642,9 @@ namespace PluginHost {
uint32_t _lastId;
ControlData _metadata;
Core::Library _library;
VARIABLE_IS_NOT_USED void* _hibernateStorage;
#ifdef HIBERNATE_SUPPORT_ENABLED
void* _hibernateStorage;
#endif
ExternalAccess _external;
ServiceMap& _administrator;
Core::SinkType<Composit> _composit;
Expand Down
4 changes: 3 additions & 1 deletion Source/core/NetworkInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1863,8 +1863,10 @@ namespace Core {

#endif

AdapterObserver::AdapterObserver(INotification* callback)
AdapterObserver::AdapterObserver(INotification* callback VARIABLE_IS_NOT_USED)
#if !defined(__WINDOWS__) && !defined(__APPLE__)
: _callback(callback)
#endif
{
#ifdef __WINDOWS__
//IoWMIOpenBlock(&GUID_NDIS_STATUS_LINK_STATE, WMIGUID_NOTIFICATION, . . .);
Expand Down
4 changes: 3 additions & 1 deletion Source/core/NetworkInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ namespace Core {
uint32_t Close();

private:
VARIABLE_IS_NOT_USED INotification* _callback;
#if !defined(__WINDOWS__) && !defined(__APPLE__)
INotification* _callback;
#endif
};

#if defined(__WINDOWS__) || defined(__APPLE__)
Expand Down
2 changes: 1 addition & 1 deletion Source/core/SystemInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ namespace Core {

SystemInfo::SystemInfo()
: m_HostName(ConstructHostname())
, m_lastUpdateCpuStats(0)
{
#ifdef __LINUX__
#ifdef __APPLE__
Expand Down Expand Up @@ -171,6 +170,7 @@ namespace Core {
m_cpuloadavg[0]=info.loads[0];
m_cpuloadavg[1]=info.loads[1];
m_cpuloadavg[2]=info.loads[2];
m_lastUpdateCpuStats = 0;
#endif
#endif

Expand Down
4 changes: 2 additions & 2 deletions Source/core/SystemInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ namespace Core {
mutable uint64_t m_freeswap;
mutable uint64_t m_cpuload;
mutable uint64_t m_cpuloadavg[3];
VARIABLE_IS_NOT_USED mutable time_t m_lastUpdateCpuStats;

void UpdateCpuStats() const;
void UpdateRealtimeInfo();

Expand All @@ -250,6 +248,8 @@ namespace Core {
mutable uint64_t m_prevCpuSystemTicks;
mutable uint64_t m_prevCpuUserTicks;
mutable uint64_t m_prevCpuIdleTicks;
#elif defined(__LINUX__)
mutable time_t m_lastUpdateCpuStats;
#endif
}; // class SystemInfo
} // namespace Core
Expand Down
Loading