An error(SOME, NULL) is alloc free at this time. But in general, the OOM strategies usually have reserved pools, whose allocations trigger if OOM flags are set. Such kmalloc flag is useful for APIs which accepts kmalloc flags as input. The KMALLOC_WAIT currently has the semantic of either alloc or kill, which allows you to not check for NULL. If code wants to go uniformly with that semantic, KMALLOC_ERROR is something which does it.
On Mon, Dec 7, 2015 at 4:54 AM, barret rhoden <[email protected]> wrote: > On 2015-12-06 at 21:19 'Davide Libenzi' via Akaros wrote: > > Would be nice to have such a flag, so that a failed allocation > > error(ENOMEM, NULL). > > > > What did Plan 9 do for that? In general, this flag wouldn't be too > hard to implement. The usage of it might have minor issues. (need to > be safe to throw and it's a situation where an alloc can fail). Also, > do we want to lose the errstr? (hardcoded to 0). > > -- > You received this message because you are subscribed to the Google Groups > "Akaros" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
