ATLAS Offline Software
Loading...
Searching...
No Matches
Control/AthAllocators/src/exceptions.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
10
12#include <format>
13#include <string.h>
14
15
16namespace SG {
17
18
19//*************************************************************************
20
21
26 : std::runtime_error ("SG::ExcDifferentAreas: Attempt to assign between ArenaSharedHeapSTLAllocators for different arenas.")
27{
28}
29
30
31//*************************************************************************
32
33
34std::string excProtection_format (int errnum)
35{
36 char* errstr = nullptr;
37 char errbuf[256];
38#ifdef _GNU_SOURCE
39 errstr = strerror_r (errnum, errbuf, sizeof(errbuf));
40#else
41 strerror_r (errnum, errbuf, sizeof(errbuf));
42 errstr = errbuf;
43#endif
44 return std::format ("SG::ExcProtection: Attempt to change memory protection failed: {}", errstr);
45}
46
47
53 : std::runtime_error (excProtection_format (errnum))
54{
55}
56
57
58//*************************************************************************
59
60
65 : std::runtime_error ("SG::ExcProtected: Attempt to change protected arena.")
66{
67}
68
69
70} // namespace SG
Exceptions that can be thrown from AthAllocators.
Forward declaration.
std::string excProtection_format(int errnum)
STL namespace.