MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / resize

Method resize

benchmarks/tbb/task.cpp:162–178  ·  view source on GitHub ↗

------------------------------------------------------------------------ Methods of affinity_partitioner_base_v3 ------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

160// Methods of affinity_partitioner_base_v3
161//------------------------------------------------------------------------
162void affinity_partitioner_base_v3::resize( unsigned factor ) {
163 // Check factor to avoid asking for number of workers while there might be no arena.
164 size_t new_size = factor ? factor*(1+governor::local_scheduler()->number_of_workers_in_my_arena()) : 0;
165 if( new_size!=my_size ) {
166 if( my_array ) {
167 NFS_Free( my_array );
168 // Following two assignments must be done here for sake of exception safety.
169 my_array = NULL;
170 my_size = 0;
171 }
172 if( new_size ) {
173 my_array = static_cast<affinity_id*>(NFS_Allocate(new_size,sizeof(affinity_id), NULL ));
174 memset( my_array, 0, sizeof(affinity_id)*new_size );
175 my_size = new_size;
176 }
177 }
178}
179
180} // namespace internal
181

Callers 12

beforeMethod · 0.45
beforeMethod · 0.45
beforeMethod · 0.45
beforeMethod · 0.45
beforeMethod · 0.45
beforeMethod · 0.45
beforeMethod · 0.45
beforeMethod · 0.45
beforeMethod · 0.45
iteration_end_implMethod · 0.45

Calls 3

NFS_FreeFunction · 0.85
NFS_AllocateFunction · 0.85

Tested by

no test coverage detected