Implicit @Safe Resources

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sun Sep 3 14:19:55 UTC 2023


On 04/09/2023 2:15 AM, Menshikov wrote:
> We have an unnecessary memory overhead. 2 bytes became 4 bytes.

A uint is 4 bytes. So it would be 4 to 8 on 32bits. On 64bit that would 
be 16 bytes due to alignment.

But it doesn't have to be wasteful.

```d
union {
	uint id;
	void* ptr;
}
```



More information about the Digitalmars-d mailing list