File tree Expand file tree Collapse file tree
runtime-light/core/kphp-core-impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33// Distributed under the GPL v3 License, see LICENSE.notice.txt
44
55#include " runtime-common/core/runtime-core.h"
6+ #include " runtime-light/k2-platform/k2-api.h"
67#include " runtime-light/state/instance-state.h"
8+ #include " runtime-light/stdlib/diagnostics/logs.h"
9+
10+ namespace {
711
812constexpr string_size_type initial_minimum_string_buffer_length = 1024 ;
913constexpr string_size_type initial_maximum_string_buffer_length = (1 << 24 );
1014
15+ } // namespace
16+
1117RuntimeContext& RuntimeContext::get () noexcept {
12- return InstanceState::get ().runtime_context ;
18+ if (auto * instance_state_ptr{k2::instance_state ()}; instance_state_ptr != nullptr ) [[likely]] {
19+ return instance_state_ptr->runtime_context ;
20+ }
21+ kphp::log::error (" unexpected access to RuntimeContext" );
1322}
1423
1524void RuntimeContext::init () noexcept {
You can’t perform that action at this time.
0 commit comments