2   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
    7  * @file  AthAllocators/ArenaBase.icc
 
   10  * @brief Part of @c Arena dealing with the list of allocators.
 
   11  *        Broken out from @c Arena to avoid a dependency loop
 
   12  *        with @c ArenaHeader.
 
   13  *        Inline implementations.
 
   21  * @brief Translate an integer index to an Allocator pointer.
 
   22  * @param i The index to look up.
 
   24  * If the index isn't valid, an assertion will be tripped.
 
   27 LockedAllocator ArenaBase::allocator (size_t i)
 
   29   ArenaAllocatorBase* allocbase = nullptr;
 
   30   std::mutex* m = nullptr;
 
   33     if (i >= m_allocs.size() || (allocbase = m_allocs[i].m_alloc.get()) == nullptr) {
 
   34       allocbase = makeAllocator(i);
 
   37     m = m_allocs[i].m_mutex.get();
 
   39     // Need to give up m_mutex before waiting on m; otherwise we can deadlock.
 
   42   return LockedAllocator (allocbase, *m);