Bug 12515 – memchr/wmemchr/dmemchr in druntime

Status
NEW
Severity
enhancement
Priority
P4
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-04-03T14:01:53Z
Last change time
2024-12-07T13:33:34Z
Assigned to
No Owner
Creator
monarchdodra
Moved to GitHub: dmd#17273 →

Comments

Comment #0 by monarchdodra — 2014-04-03T14:01:53Z
This is a request to have a trio of functions in druntime, that do what memchr does, but also for 1-byte, 2-byte and 4-byte widths (and maybe 8 bytes too). The issue with C's wmemchr is that works on `wchar_t`, which may be either a wchar or dchar, making it horribly difficult to use in a generic way (or at all). Having these methods in druntime would be able to do memory wise search in a much easier fashion. It would also have the advantage of: - accept a "const(void)[]" as input, so using them is "just safe". - have a __ctfe branch, so no special branches need to be deployed by the caller: It "just works". Not sure which druntime (or phobos?) library it would go into. Also, a rename might help, to avoid ambiguity "[cwdl]memsearch?"
Comment #1 by andrej.mitrovich — 2014-04-03T14:20:26Z
Speaking of which, will this be reopened? https://github.com/D-Programming-Language/phobos/pull/1665
Comment #2 by robert.schadek — 2024-12-07T13:33:34Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17273 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB