My advice on implementing stuff in C:
My advice on implementing stuff in C:
Posted Oct 25, 2010 11:04 UTC (Mon) by mjthayer (guest, #39183)In reply to: My advice on implementing stuff in C: by wahern
Parent article: Russell: On C Library Implementation
Just out of interest, are there really no simple ways (as nix suggested) to allocate a fixed-size stack at programme begin in Linux userland? I can't see any theoretical reasons why it should be a problem.
> And if you use good design habits, like RAII (not just a C++ pattern), then the places for malloc failure to occur are well isolated.
Again, I am interested in how you do RAII in C. I know the (in my opinion ugly and error-prone) goto way, and I could think of ways to do at run time what C++ does at compile time (doesn't have to be a bad thing, although more manual steps would be needed). Do you have any other insights?
