mirror of
https://github.com/esphome/esphome.git
synced 2026-03-01 02:14:19 -07:00
Merge remote-tracking branch 'origin/app-placement-new' into integration
This commit is contained in:
@@ -675,6 +675,7 @@ void Application::yield_with_select_(uint32_t delay_ms) {
|
||||
#ifndef __GXX_ABI_VERSION
|
||||
#error "Application placement new requires Itanium C++ ABI (GCC/Clang)"
|
||||
#endif
|
||||
static_assert(std::is_default_constructible<Application>::value, "Application must be default-constructible");
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
alignas(Application) char app_storage[sizeof(Application)] asm("_ZN7esphome3AppE");
|
||||
|
||||
|
||||
@@ -513,7 +513,7 @@ async def to_code(config: ConfigType) -> None:
|
||||
cg.add_global(cg.RawExpression("using std::max"))
|
||||
|
||||
# Construct App via placement new — see application.cpp for storage details
|
||||
cg.add_global(cg.RawExpression("#include <new>"))
|
||||
cg.add_global(cg.RawStatement("#include <new>"))
|
||||
cg.add(cg.RawExpression("new (&App) Application()"))
|
||||
cg.add(
|
||||
cg.App.pre_setup(
|
||||
|
||||
Reference in New Issue
Block a user