Bug 2818 – Pointer parameters in core.memory should be const(void)*.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-04-07T13:10:00Z
Last change time
2015-06-09T01:18:03Z
Assigned to
nobody
Creator
dsimcha
Comments
Comment #0 by dsimcha — 2009-04-07T13:10:25Z
In core.memory, functions that do not affect the validity or contents of the underlying memory regions should have signatures of ReturnType function(const void*), not ReturnType function(void*). These include GC.sizeOf(), GC.addrOf(), and GC.realloc(). There is simply no reason why these would be unsafe to call on pointers to const/immutable objects, and as such, this should not require an explicit cast.