Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoNewGlobals for Comm::AcceptLimiter::Instance_ #1954

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 0 additions & 3 deletions src/comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1154,9 +1154,6 @@ comm_init(void)
{
assert(fd_table);

/* make sure the accept() socket FIFO delay queue exists */
Comm::AcceptLimiter::Instance();

// make sure the IO pending callback table exists
Comm::CallbackTableInit();

Expand Down
5 changes: 2 additions & 3 deletions src/comm/AcceptLimiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
#include "fde.h"
#include "globals.h"

Comm::AcceptLimiter Comm::AcceptLimiter::Instance_;

Comm::AcceptLimiter &
Comm::AcceptLimiter::Instance()
{
return Instance_;
static const auto Instance_ = new AcceptLimiter();
return *Instance_;
}

void
Expand Down
2 changes: 0 additions & 2 deletions src/comm/AcceptLimiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class AcceptLimiter
void kick();

private:
static AcceptLimiter Instance_;

/** FIFO queue */
std::deque<TcpAcceptor::Pointer> deferred_;
};
Expand Down