D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2818 - Pointer parameters in core.memory should be const(void)*.
Summary: Pointer parameters in core.memory should be const(void)*.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-07 13:10 UTC by David Simcha
Modified: 2015-06-09 01:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2009-04-07 13:10:25 UTC
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.
Comment 1 David Simcha 2011-08-27 07:43:55 UTC
This was fixed a long time ago.