From mai at lapyst.by Thu Oct 5 11:36:17 2023 From: mai at lapyst.by (Mai Lapyst) Date: Thu, 05 Oct 2023 11:36:17 +0000 Subject: [phobos] Historic background of std.regex and BacktrackingMatcher Message-ID: I'm currently working through the dmd (and phobos for that matter), and come across it's regex implementation. Here I found out it makes rather heavy usage of malloc / pureMalloc; on one side to allocate the Matcher implementation inside `GenericFactory`; on the other side in `BacktrackingMatcher` for memory of it's stack. Is there any historic reason why it dosnt uses more D-like features like `new` or dynamic arrays? It would certainly be safer to do so than using an untyped region of memory as stack-space. Also: if it needs "plain" memory; would this code be a good candidate to utilize `std.experimental.allocator` once released? Cheers, Mai