2828#include < sys/eventfd.h>
2929#endif
3030
31- using std::atomic;
32- using std::vector;
33-
34- using td::int32;
35- using td::uint32;
36-
3731#define MODE std::memory_order_relaxed
3832
3933// void set_affinity(int mask) {
@@ -100,7 +94,7 @@ class Backoff {
10094};
10195
10296class VarQueue {
103- atomic<qvalue_t > data;
97+ std:: atomic<qvalue_t > data{ 0 } ;
10498
10599 public:
106100 void init () {
@@ -218,17 +212,17 @@ const int queue_buf_size = 1 << 10;
218212class BufferQueue {
219213 struct node {
220214 qvalue_t val;
221- char pad[64 - sizeof (atomic<qvalue_t >)];
215+ char pad[64 - sizeof (std:: atomic<qvalue_t >)];
222216 };
223217 node q[queue_buf_size];
224218
225219 struct Position {
226- atomic<uint32> i;
227- char pad[64 - sizeof (atomic<uint32>)];
220+ std:: atomic<td:: uint32> i{ 0 } ;
221+ char pad[64 - sizeof (std:: atomic<td:: uint32>)];
228222
229- uint32 local_read_i;
230- uint32 local_write_i;
231- char pad2[64 - sizeof (uint32) * 2 ];
223+ td:: uint32 local_read_i;
224+ td:: uint32 local_write_i;
225+ char pad2[64 - sizeof (td:: uint32) * 2 ];
232226
233227 void init () {
234228 i = 0 ;
@@ -342,7 +336,7 @@ class BufferQueue {
342336#if TD_LINUX
343337class BufferedFdQueue {
344338 int fd;
345- atomic<int > wait_flag;
339+ std:: atomic<int > wait_flag{ 0 } ;
346340 BufferQueue q;
347341 char pad[64 ];
348342
@@ -440,7 +434,7 @@ class BufferedFdQueue {
440434
441435class FdQueue {
442436 int fd;
443- atomic<int > wait_flag;
437+ std:: atomic<int > wait_flag{ 0 } ;
444438 VarQueue q;
445439 char pad[64 ];
446440
@@ -572,8 +566,8 @@ class QueueBenchmark2 : public td::Benchmark {
572566
573567 int server_active_connections;
574568 int client_active_connections;
575- vector<td::int64> server_conn;
576- vector<td::int64> client_conn;
569+ std:: vector<td::int64> server_conn;
570+ std:: vector<td::int64> client_conn;
577571
578572 public:
579573 explicit QueueBenchmark2 (int connections_n = 1 ) : connections_n(connections_n) {
@@ -615,7 +609,7 @@ class QueueBenchmark2 : public td::Benchmark {
615609 }
616610
617611 void *server_run (void *) {
618- server_conn = vector<td::int64>(connections_n);
612+ server_conn = std:: vector<td::int64>(connections_n);
619613 server_active_connections = connections_n;
620614
621615 while (server_active_connections > 0 ) {
@@ -656,7 +650,7 @@ class QueueBenchmark2 : public td::Benchmark {
656650 }
657651
658652 void *client_run (void *) {
659- client_conn = vector<td::int64>(connections_n);
653+ client_conn = std:: vector<td::int64>(connections_n);
660654 client_active_connections = connections_n;
661655 if (queries_n >= (1 << 24 )) {
662656 std::fprintf (stderr, " Too big queries_n\n " );
@@ -732,7 +726,7 @@ class QueueBenchmark : public td::Benchmark {
732726 }
733727
734728 void *server_run (void *) {
735- vector<td::int64> conn (connections_n);
729+ std:: vector<td::int64> conn (connections_n);
736730 int active_connections = connections_n;
737731 while (active_connections > 0 ) {
738732 qvalue_t value = server.get ();
@@ -756,7 +750,7 @@ class QueueBenchmark : public td::Benchmark {
756750 }
757751
758752 void *client_run (void *) {
759- vector<td::int64> conn (connections_n);
753+ std:: vector<td::int64> conn (connections_n);
760754 if (queries_n >= (1 << 24 )) {
761755 std::fprintf (stderr, " Too big queries_n\n " );
762756 std::exit (0 );
@@ -789,7 +783,7 @@ class QueueBenchmark : public td::Benchmark {
789783 }
790784
791785 void *client_run2 (void *) {
792- vector<td::int64> conn (connections_n);
786+ std:: vector<td::int64> conn (connections_n);
793787 if (queries_n >= (1 << 24 )) {
794788 std::fprintf (stderr, " Too big queries_n\n " );
795789 std::exit (0 );
0 commit comments