[Issue 20813] New: std.experimental.allocator add fault injecting allocator
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri May 8 22:52:29 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20813
Issue ID: 20813
Summary: std.experimental.allocator add fault injecting
allocator
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: witold.baryluk+d at gmail.com
A feature request of adding an allocator building block that with a given
probability simply fails to allocate memory and returns null. Otherwise
allocate from the parent. Determination can be done using per-thread random
generator for example. Extra conditions (i.e. do different probabilities for
different sizes) can be done using other allocator building blocks.
As a bonus it might be useful in some cases to fail multiple consecutive calls
to allocate(), not just do it every 1000 calls. I.e. fail 3 calls to
allocate().
--
More information about the Digitalmars-d-bugs
mailing list