2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5#include "AthAllocators/ArenaCachingHandle.h"
6#include "AthAllocators/ArenaHandle.h"
7#include "AthAllocators/ArenaPoolAllocator.h"
8#include "StoreGate/tools/SGMsgStreamMacros.h"
10/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14SegMemSvc::allocate(SegMemSvc::LIFETIME life, bool cache) {
19 typedef SG::ArenaCachingHandle<T, SG::ArenaPoolAllocator> Handle_t;
20 if (life == SegMemSvc::EVENT) {
21 ptr = (T*)Handle_t(&m_ahead_evt).allocate();
22 } else if (life == SegMemSvc::JOB) {
23 ptr = (T*)Handle_t(&m_ahead_job).allocate();
24 } else if (life == SegMemSvc::INCIDENT) {
25 ptr = (T*)Handle_t(&m_ahead_inc).allocate();
28 typedef SG::ArenaHandle<T, SG::ArenaPoolAllocator> Handle_t;
29 if (life == SegMemSvc::EVENT) {
30 ptr = (T*)Handle_t(&m_ahead_evt).allocate();
31 } else if (life == SegMemSvc::JOB) {
32 ptr = (T*)Handle_t(&m_ahead_job).allocate();
33 } else if (life == SegMemSvc::INCIDENT) {
34 ptr = (T*)Handle_t(&m_ahead_inc).allocate();
38 if (msgStream().level() <= MSG::DEBUG) {
39 SG_MSG_DEBUG ("allocating object size {} with lifetime/cache {}/{} at {}",
40 sizeof(T), cvt(life), cache,
41 static_cast<void*>(ptr));
49/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
53SegMemSvc::del(T* ptr) {
55 if (msgStream().level() <= MSG::DEBUG) {
56 SG_MSG_DEBUG ("deleting object at {}", static_cast<void*>(ptr));