Hacker News new | ask | show | jobs
by benibela 960 days ago
Or clever code that should not be fixed

I just added my own tagging to my pointers. I have 48-bit pointers and 16-bit of tagging data.

I replaced all my struct { word type; char* data }; with something like (type << 48) | data. This saves a memory allocation and pointer indirection. It is much faster