[network] Store use_address in RODATA to save RAM (#11707)
This commit is contained in:
1 parent
aed7505f53
commit
531b27582a
11 files changed
+33
-22
No files matched your search
@@ -85,7 +85,7 @@ network::IPAddresses get_ip_addresses() {
|
||||
return {};
|
||||
}
|
||||
|
||||
const std::string &get_use_address() {
|
||||
const char *get_use_address() {
|
||||
// Global component pointers are guaranteed to be set by component constructors when USE_* is defined
|
||||
#ifdef USE_ETHERNET
|
||||
return ethernet::global_eth_component->get_use_address();
|
||||
@@ -105,8 +105,7 @@ const std::string &get_use_address() {
|
||||
|
||||
#if !defined(USE_ETHERNET) && !defined(USE_MODEM) && !defined(USE_WIFI) && !defined(USE_OPENTHREAD)
|
||||
// Fallback when no network component is defined (e.g., host platform)
|
||||
static const std::string empty;
|
||||
return empty;
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user