You are not logged in.
Hello everyone!
I know how to hide the entire struct definition so its members are not accessible when using it. That is, seperating the struct definition in the source file from the typedef in the header file. However, scanning through the Glib reference manual, the Arrays "class" somehow shows only part of the "public" members of the GArray structure. And all of them seemingly primitive types. So it's not a trick using so-called "incomplete types". How do they do it? Currently, I am simply using getter-like functions.
My second question is about malloc(). I realise implementations differ, but I would like to know where I can find answers. I found a paper on an interesting ADT concept and I would very much like to implement it. But for that, I would need to know how much the malloc() header size is. The header that is added to every allocated block so that, for example, free() knows what to do. As far as I have searched, I have found info on either 8 or 16 bytes, but have no way of telling which one is true, if either.
Thanks for your help!
Also, the thing I'm implementing, or trying to, is called "Resizable Arrays in Optimal Time and Space". If anyone's going to look into it, which is unnecessary for this topic, be aware that there is an error at the calculation for the element indices. Mention this in the topic if you need the correct one, or just Google it, that's how I found it.
Last edited by Nanthiel (2011-10-01 21:52:30)
Offline