Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions runtime/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ Optional<string> f$realpath(const string& path) {
}

static Optional<string> full_realpath(const string& path) { // realpath resolving only dirname to work with unexisted files
static char full_realpath_cache_storage[sizeof(array<string>)];
alignas(array<string>) static char full_realpath_cache_storage[sizeof(array<string>)];
static array<string>* full_realpath_cache = reinterpret_cast<array<string>*>(full_realpath_cache_storage);
static long long full_realpath_last_query_num = -1;

Expand Down Expand Up @@ -567,7 +567,7 @@ Optional<array<string>> f$scandir(const string& directory) {
return file_list;
}

static char opened_files_storage[sizeof(array<FILE*>)];
alignas(array<FILE*>) static char opened_files_storage[sizeof(array<FILE*>)];
static array<FILE*>* opened_files = reinterpret_cast<array<FILE*>*>(opened_files_storage);
static long long opened_files_last_query_num = -1;

Expand Down
6 changes: 3 additions & 3 deletions runtime/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ int64_t f$ob_get_level() {

static int http_return_code;
static string http_status_line;
static char headers_storage[sizeof(array<string>)];
alignas(array<string>) static char headers_storage[sizeof(array<string>)];
static array<string>* headers = reinterpret_cast<array<string>*>(headers_storage);
static long long header_last_query_num = -1;
static bool headers_custom_handler_invoked = false;
Expand Down Expand Up @@ -1329,7 +1329,7 @@ static bool parse_multipart(const char* post, int post_len, const string& bounda
return true;
}

static char arg_vars_storage[sizeof(array<string>)];
alignas(array<string>) static char arg_vars_storage[sizeof(array<string>)];
static array<string>* arg_vars = nullptr;

Optional<int64_t>& get_dummy_rest_index() noexcept {
Expand Down Expand Up @@ -1897,7 +1897,7 @@ std::tuple<int64_t, int64_t, int64_t, int64_t> f$get_webserver_stats() {
return {stats.running_workers, stats.waiting_workers, stats.ready_for_accept_workers, stats.total_workers};
}

static char ini_vars_storage[sizeof(array<string>)];
alignas(array<string>) static char ini_vars_storage[sizeof(array<string>)];
static array<string>* ini_vars = nullptr;

void ini_set(vk::string_view key, vk::string_view value) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/openssl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ struct ssl_connection {
SSL_CTX* ssl_ctx;
};

static char ssl_connections_storage[sizeof(array<ssl_connection>)];
alignas(array<ssl_connection>) static char ssl_connections_storage[sizeof(array<ssl_connection>)];
static array<ssl_connection>* ssl_connections = reinterpret_cast<array<ssl_connection>*>(ssl_connections_storage);
static long long ssl_connections_last_query_num = -1;

Expand Down
2 changes: 1 addition & 1 deletion runtime/regexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ bool regexp::is_valid_RE2_regexp(const char* regexp_string, int64_t regexp_len,
}

void regexp::init(const string& regexp_string, const char* function, const char* file) {
static char regexp_cache_storage[sizeof(array<regexp*>)];
alignas(array<regexp*>) static char regexp_cache_storage[sizeof(array<regexp*>)];
static array<regexp*>* regexp_cache = (array<regexp*>*)regexp_cache_storage;
static long long regexp_last_query_num = -1;

Expand Down
2 changes: 1 addition & 1 deletion runtime/udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

int DEFAULT_SOCKET_TIMEOUT = 60;

static char opened_udp_sockets_storage[sizeof(array<int>)];
alignas(array<int>) static char opened_udp_sockets_storage[sizeof(array<int>)];
static array<int>* opened_udp_sockets = reinterpret_cast<array<int>*>(opened_udp_sockets_storage);
static long long opened_udp_sockets_last_query_num = -1;

Expand Down
Loading