mirror of
https://github.com/MariaDB/server.git
synced 2025-02-06 22:02:20 +01:00
![Vicențiu Ciorbaru](/assets/img/avatar_default.png)
This patch is the result of running run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' . Code style changes have been done on top. The result of this change leads to the following improvements: 1. Binary size reduction. * For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by ~400kb. * A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb. 2. Compiler can better understand the intent of the code, thus it leads to more optimization possibilities. Additionally it enabled detecting unused variables that had an empty default constructor but not marked so explicitly. Particular change required following this patch in sql/opt_range.cc result_keys, an unused template class Bitmap now correctly issues unused variable warnings. Setting Bitmap template class constructor to default allows the compiler to identify that there are no side-effects when instantiating the class. Previously the compiler could not issue the warning as it assumed Bitmap class (being a template) would not be performing a NO-OP for its default constructor. This prevented the "unused variable warning".
58 lines
1.1 KiB
C++
58 lines
1.1 KiB
C++
|
|
// vim:sw=2:ai
|
|
|
|
/*
|
|
* Copyright (C) 2010 DeNA Co.,Ltd.. All rights reserved.
|
|
* See COPYRIGHT.txt for details.
|
|
*/
|
|
|
|
#ifndef DENA_HSTCPSVR_HPP
|
|
#define DENA_HSTCPSVR_HPP
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <map>
|
|
|
|
#include "mutex.hpp"
|
|
#include "auto_file.hpp"
|
|
#include "database.hpp"
|
|
#include "config.hpp"
|
|
#include "socket.hpp"
|
|
|
|
namespace dena {
|
|
|
|
struct hstcpsvr_shared_c {
|
|
config conf;
|
|
long num_threads;
|
|
long nb_conn_per_thread;
|
|
bool for_write_flag;
|
|
bool require_auth;
|
|
std::string plain_secret;
|
|
int readsize;
|
|
socket_args sockargs;
|
|
auto_file listen_fd;
|
|
database_ptr dbptr;
|
|
volatile unsigned int *thread_num_conns; /* 0 .. num_threads-1 */
|
|
hstcpsvr_shared_c() : num_threads(0), nb_conn_per_thread(100),
|
|
for_write_flag(false), require_auth(false), readsize(0),
|
|
thread_num_conns(0) { }
|
|
};
|
|
|
|
struct hstcpsvr_shared_v : public mutex {
|
|
int shutdown;
|
|
hstcpsvr_shared_v() : shutdown(0) { }
|
|
};
|
|
|
|
struct hstcpsvr_i;
|
|
typedef std::auto_ptr<hstcpsvr_i> hstcpsvr_ptr;
|
|
|
|
struct hstcpsvr_i {
|
|
virtual ~hstcpsvr_i() = default;
|
|
virtual std::string start_listen() = 0;
|
|
static hstcpsvr_ptr create(const config& conf);
|
|
};
|
|
|
|
};
|
|
|
|
#endif
|
|
|