Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, the GLib documentation is not very good at pointing this out, unfortunately.

I'm also thinking about maybe creating a slightly incompatible version which might use "c_" as a prefix instead of "g_". There would also need to be some changes to the interface and not only the return values because the methods that do a realloc internally only return a pointer to the object itself (e.g. GString*) for chaining and therefore cannot be used to signal an error condition.

But not sure, yet if this is a good idea or just creates confusion.

For the moment I just want to provide the (in my opinion) by far most important classes of GLib because I always missed something like that in the C standard library. This is also why I chose to implement it header-only. It should be as easy as possbile for people to use them.

The out of memory handling is very unfortunate and you should probably not use this code in the middle of a database transaction or something similar but I think for most user level code and situations where you would handle out of memory with exit anyway it is ok as it is.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: