4 ms·
> No prob with size_t and char* I think. They'll nicely solidify to 4 bytes on 32-bit platforms. I'd need to test for maximum though in size_t .len case. I me
by iExploder 4y ago
> No prob with size_t and char* I think. They'll nicely solidify to 4 bytes on 32-bit platforms. I'd need to test for maximum though in size_t .len case.
I mean on 32 bit platform the offset to union tag would be different depending on the struct the union holds, unless I'm missing something
- alcover 4y agoThe hard values in the readme may be confusing. The real model is union { struct { char* data; size_t len; size_t off:8*sizeof(size_t)-TAGBITS, tag:TAGBITS; } ptr; struct { char data[sizeof(BuffetPtr)-2]; uint8_t refcnt; uint8_t len:8-TAGBITS, tag:TAGBITS; } sso; } where the tag falls into place. I tried an older version on 32 bit and it worked ok.
- iExploder 4y agoahhh thanks, now that makes more sense to me