2 ms·
> Still, if C gets fat pointers that's at least a step in the right direction. AFAIK the C standard doesn't prevent an implementation from using fat pointers,
by 1718627440 10mo ago
> Still, if C gets fat pointers that's at least a step in the right direction.
AFAIK the C standard doesn't prevent an implementation from using fat pointers, this is one of the reasons why the conversion from pointer to integer only works in one direction. This is actually necessary for segmented memory. The compiler is allowed to optimize based on the assumption, which allocation a pointer comes from (including the allocations boundaries, i.e. size), even if bytewise the pointers would be equal, so you could argue, that C abstract machine already has fat pointers.
- uecker 10mo agoIndeed. C implementation could just use fat pointers, but it is unrealistic that they now break their ABI. Also the cost of fat pointers is higher when not needed. So the plan is to give them a new wide pointer type.