On 6/3/2017 12:22 PM, bob by wrote: > > Can you please tell how large C programs usually organize memory? Bunch of > structures and globals I guess?
Yes. C is not Rust, it doesn't have an intricate memory ownership model. You have chunks of memory and pointers to it. What you put there is up to you, but - yes, structures and arrays tend to dominate. Global variables are not encouraged, for obvious reasons. There are some tricks, like slice allocators (which allow faster-than-malloc allocations of small uniformly-sized chunks of memory), but that's for special cases. Generally it's just heap and stack. You'd have to be more specific to get a more precise answer. > > Any programs whose source you'd recommend reading? I would recommend reading books. Much easier to find pertinent information there. Read the source code to learn what it does or how it does it, and to make modifications. If you must read the source code, read the projects that generate documentation from it - that usually forces people to be more descriptive and add more comments. Also, if a project has some kind of style guide and best practices list, that's a plus - the code will be easier to read, and the list itself might point you at interesting stuff. I can probably suggest you look at GSoC projects, as they had to accommodate newcomers, and thus they should have some pertinent info laying around on their websites and wikis. > > Not sure if I should send questions like that in this mailing list, maybe I > should ask directly. Well, MinGW-w64-related questions would be more appropriate here. On the other hand, people here *do* have some answers, so you might as well keep going, unless someone points you towards the door. -- O< ascii ribbon - stop html email! - www.asciiribbon.org
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public