Sujet : Re: "White House to Developers: Using C or C++ Invites Cybersecurity Risks"
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : comp.lang.c++ comp.lang.cDate : 09. Mar 2024, 23:16:18
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <usin3i$2htsq$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Mozilla Thunderbird
On 3/9/2024 4:25 AM, David Brown wrote:
On 08/03/2024 22:23, Chris M. Thomasson wrote:
On 3/6/2024 2:18 PM, Chris M. Thomasson wrote:
On 3/6/2024 2:43 AM, David Brown wrote:
[...]
>
This is a fun one:
>
// pseudo code...
_______________________
node*
node_pop()
{
// try per-thread lifo
>
// try shared distributed lifo
>
// try global region
>
// if all of those failed, return nullptr
}
>
Just to be clear here - if this is in a safety-critical system, and your allocation system returns nullptr, people die. That is why you don't use this kind of thing for important tasks.
In this scenario, nullptr returned means the main region allocator is out of memory. So, pool things up where this never occurs.