It is safe to use stdlib allocator functions with XLib allocations (those requiring `XFree`)

48 Views Asked by At

Just wondering whether it's okay to use standard allocator functions (in this case realloc) in a portable XLib application? From what I can see the XLib source just defines XFree to free but I'm not taking that as an assurance of portability, considering alternate or older impls.

My specific case atm. is just a cleaner way to use XGet/XSetWMProtocols, as I can just realloc the returned Atom array rather than needing to copy over. It's a small thing but it'd be nice if I could.

If it's something that has "always been fine in practice" and as such assumedly always will be I don't really mind, I'm more focused here on correctness.

Thanks!

0

There are 0 best solutions below