This repository was archived by the owner on Sep 3, 2023. It is now read-only.
Commit a9441bf 1 parent d08b74f commit a9441bf Copy full SHA for a9441bf
File tree 3 files changed +18
-7
lines changed
3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ add_library(air STATIC ${SOURCE_FILES})
3
3
target_include_directories (air PUBLIC ${CMAKE_SOURCE_DIR} )
4
4
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)
5
5
message (STATUS "compile option -fconstexpr-ops-limit is used" )
6
- target_compile_options (air PRIVATE -std=c++14 -Wall -Werror -O3 -mavx2 -fPIC -fconstexpr-ops-limit=123456789)
6
+ target_compile_options (air PRIVATE -std=c++14 -Wall -Werror -g - O3 -mavx2 -fPIC -fconstexpr-ops-limit=123456789)
7
7
else ()
8
8
message (STATUS "compile option -fconstexpr-loop-limit is used" )
9
- target_compile_options (air PRIVATE -std=c++14 -Wall -Werror -O3 -mavx2 -fPIC -fconstexpr-loop-limit=123456789)
9
+ target_compile_options (air PRIVATE -std=c++14 -Wall -Werror -g - O3 -mavx2 -fPIC -fconstexpr-loop-limit=123456789)
10
10
endif ()
11
11
target_link_libraries (air pthread)
Original file line number Diff line number Diff line change @@ -113,8 +113,16 @@ process::Preprocessor::_ConvertData(void)
113
113
lib::LatencyData* lat_data = data.done_to .back ();
114
114
for (auto & timelog : lat_data->end_v )
115
115
{
116
- data.timelog_to .push_back (timelog);
117
- need_update = true ;
116
+ if (data.timelog_to_size < MAX_TIMELOG_TO_SIZE - 1 )
117
+ {
118
+ data.timelog_to [data.timelog_to_size ] = timelog;
119
+ data.timelog_to_size ++;
120
+ need_update = true ;
121
+ }
122
+ else
123
+ {
124
+ break ;
125
+ }
118
126
}
119
127
data.done_to .pop_back ();
120
128
}
@@ -138,8 +146,9 @@ process::Preprocessor::_MatchData(void)
138
146
}
139
147
data.update = false ;
140
148
141
- for (auto & timelog : data.timelog_to )
149
+ for (uint32_t index { 0 }; index < data.timelog_to_size ; index ++ )
142
150
{
151
+ auto & timelog {data.timelog_to [index ]};
143
152
auto it_match = data.timestamp_from .find (timelog.key );
144
153
if (it_match != data.timestamp_from .end ())
145
154
{
@@ -178,7 +187,7 @@ process::Preprocessor::_CleanData(int option)
178
187
data.done_from .clear ();
179
188
data.done_to .clear ();
180
189
data.timestamp_from .clear ();
181
- data.timelog_to . clear () ;
190
+ data.timelog_to_size = 0 ;
182
191
}
183
192
match_map.clear ();
184
193
}
Original file line number Diff line number Diff line change @@ -56,12 +56,14 @@ class Preprocessor
56
56
void _MatchData (void );
57
57
void _CleanData (int option);
58
58
59
+ static const uint32_t MAX_TIMELOG_TO_SIZE {100000 };
59
60
struct match_st
60
61
{
61
62
std::vector<lib::LatencyData*> done_from;
62
63
std::vector<lib::LatencyData*> done_to;
63
64
std::map<uint64_t , timespec > timestamp_from;
64
- std::vector<lib::TimeLog> timelog_to;
65
+ lib::TimeLog timelog_to[MAX_TIMELOG_TO_SIZE];
66
+ uint32_t timelog_to_size {0 };
65
67
bool done {false };
66
68
bool update {false };
67
69
};
You can’t perform that action at this time.
0 commit comments