Bug 20813 – std.experimental.allocator add fault injecting allocator

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-05-08T22:52:29Z
Last change time
2024-12-01T16:36:43Z
Assigned to
No Owner
Creator
Witold Baryluk
Moved to GitHub: phobos#10416 →

Comments

Comment #0 by witold.baryluk+d — 2020-05-08T22:52:29Z
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().
Comment #1 by robert.schadek — 2024-12-01T16:36:43Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10416 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB