Bug 22521 – [CTFE] std.experimental.allocator.make and dispose are not CTFEable.

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-11-18T12:29:48Z
Last change time
2024-12-01T16:39:41Z
Assigned to
No Owner
Creator
Tomoya Tanjo
Moved to GitHub: phobos#10485 →

Comments

Comment #0 by ttanjo — 2021-11-18T12:29:48Z
Custom allocators are useful for performance (e.g., std.regex internally uses its custom allocator)and std.experimental.allocator provides a generic interface for them: `make` family and `dispose` family. However, current interface of std.experimental.allocator prevents functions that use custom allocator from CTFEability. It would be nice if `make` family and `dispose` family can provide an interface that enables CTFEability while keeping its flexibility. Here is a current interface of `make`. ```dlang auto make(T, Allocator, A...)(auto ref Allocator alloc, auto ref A args); ``` A problem is that it takes a custom allocator as a runtime parameter. If `make` take a custom allocator as a template alias parameter, we will solve this issue. PoC: https://run.dlang.io/is/WYSaLd
Comment #1 by robert.schadek — 2024-12-01T16:39:41Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10485 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB