| 258 | namespace |
| 259 | { |
| 260 | U32 create_ptanks(group_data& group, u32 count) |
| 261 | { |
| 262 | U32 initial_size = group.size; |
| 263 | if (initial_size + count > group.max_size) |
| 264 | { |
| 265 | count = group.max_size - initial_size; |
| 266 | } |
| 267 | |
| 268 | ptank_context* end = group.ptanks + initial_size + count; |
| 269 | ptank_context* it = group.ptanks + initial_size; |
| 270 | while (it < end) |
| 271 | { |
| 272 | RpAtomic* ptank = create_ptank(group.create_flags); |
| 273 | it->ptank = ptank; |
| 274 | |
| 275 | if (it->ptank == NULL) |
| 276 | { |
| 277 | break; |
| 278 | } |
| 279 | |
| 280 | it->flags = rpPTANKDFLAGPOSITION; |
| 281 | it->next = *group.buckets; |
| 282 | *group.buckets = it; |
| 283 | it++; |
| 284 | group.size++; |
| 285 | } |
| 286 | |
| 287 | return group.size - initial_size; |
| 288 | } |
| 289 | |
| 290 | } // namespace |
| 291 |
no test coverage detected