310 {
311 if(n > m_page_size) {
312 return nullptr;
313 }
314
315 const size_t n_bucket = choose_bucket(n);
316
317 if(n_bucket > 0) {
319
320 std::deque<Bucket>& buckets = m_buckets_for[n_bucket];
321
322
323
324
325
326
327
328 for(auto& bucket : buckets) {
329 if(uint8_t* p = bucket.alloc()) {
330 return p;
331 }
332
333
334
335 }
336
337 if(!m_free_pages.empty()) {
338 uint8_t* ptr = m_free_pages[0];
339 m_free_pages.pop_front();
340#if defined(BOTAN_MEM_POOL_USE_MMU_PROTECTIONS)
342#endif
343 buckets.push_front(Bucket(ptr, m_page_size, n_bucket));
344 void* p = buckets[0].alloc();
346 return p;
347 }
348 }
349
350
351 return nullptr;
352}
#define BOTAN_ASSERT_NOMSG(expr)
secure_vector< T > lock(const std::vector< T > &in)
lock_guard< T > lock_guard_type