Skip to content

Commit

Permalink
remove deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Sadokhov committed Sep 5, 2023
1 parent 0718856 commit 13894a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion server/job-workers/job-worker-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int jobs_server_php_wakeup(connection *c) {
double timeout = worker->enter_lifecycle();

if (timeout == 0) {
delete worker;
worker->~PhpWorker();
jobs_server_at_query_end(c);
} else {
assert(c->pending_queries >= 0 && c->status == conn_wait_net);
Expand Down
8 changes: 4 additions & 4 deletions server/php-engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ int do_hts_func_wakeup(connection *c, bool flag) {
assert(worker);
double timeout = worker->enter_lifecycle();
if (timeout == 0) {
delete worker;
worker->~PhpWorker();
hts_at_query_end(c, flag);
} else {
assert (timeout > 0);
Expand Down Expand Up @@ -641,7 +641,7 @@ int hts_func_close(connection *c, int who __attribute__((unused))) {
double timeout = worker->enter_lifecycle();
D->extra = nullptr;
assert ("worker is unfinished after closing connection" && timeout == 0);
delete worker;
worker->~PhpWorker();
}
return 0;
}
Expand Down Expand Up @@ -826,7 +826,7 @@ int rpcx_func_wakeup(connection *c) {
assert(worker);
double timeout = worker->enter_lifecycle();
if (timeout == 0) {
delete worker;
worker->~PhpWorker();
rpcx_at_query_end(c);
} else {
assert (c->pending_queries >= 0 && c->status == conn_wait_net);
Expand All @@ -845,7 +845,7 @@ int rpcx_func_close(connection *c, int who __attribute__((unused))) {
double timeout = worker->enter_lifecycle();
D->extra = nullptr;
assert ("worker is unfinished after closing connection" && timeout == 0);
delete worker;
worker->~PhpWorker();

if (!has_pending_scripts()) {
lease_set_ready();
Expand Down
2 changes: 1 addition & 1 deletion server/php-worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ void PhpWorker::state_free_script() noexcept {
static int finished_queries = 0;
if ((++finished_queries) % queries_to_recreate_script == 0
|| (!use_madvise_dontneed && php_script->memory_get_total_usage() > memory_used_to_recreate_script)) {
delete php_script;
php_script->~PhpScript();
php_script = nullptr;
finished_queries = 0;
}
Expand Down

0 comments on commit 13894a6

Please sign in to comment.