OK to do bit-packing with GC pointers?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sat Jul 23 08:32:12 UTC 2022


On Saturday, 23 July 2022 at 00:55:14 UTC, Steven Schveighoffer 
wrote:
> Probably. Though like I said, I doubt it matters. Maybe someone 
> with more type theory or GC knowledge knows whether it should 
> be OK or not.

Has nothing to do with type theory, only about GC implementation. 
But his object has no pointer in it so it should be allocated in 
a "no scan" heap, that can't work.

Also `char*` can't work as char cannot contain pointers. I guess 
you would need to use `void*`.

But you need to understand the internals of the GC implementation 
to do stuff like this.



More information about the Digitalmars-d-learn mailing list