> 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
The 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.ahhh thanks, now that makes more sense to me
MIT might be a better license for broad adoption. Both GPL and LGPL are viral licenses. They serve a purpose, but you need to assess if that purpose is the same as yours.
Would you object to MIT now and GPL/dual later when mature ? Though I suppose the license doesn't count when people are just trying the lib (which they seemingly don't..)
Re:Proposal for a full-fledged C String
by OmarAssadi on Monday July 11, 2022 @03:35PM
(#32060718)
If it were dual-licensed, I think it’d be hard to find anyone who’d object. GPL is scary to me, though, since I prefer to license my stuff under pretty unrestrictive licenses, and I don’t really want to deal with the virality.
GPL : Not really. Maybe LGPL would do. I want the lib to promote open source and that's it.