News for hackers. Stuff that matters.
Re:Why I Write Games in C (yes, C) by ncmncm on Tuesday September 24, 2019 @12:59AM (#21056714)
In other words, you can't do RAII.

Instead you call a constructor that sets a dumb default state, and then another, "init()" function, that sets the state to something else, and returns a status result. But first it has to check if it is already init'd, and maybe deinit() first, if so, or maybe fail. Then you check the result of init(), and handle whatever that is, and return some failure. Otherwise, you do some work, and then call deinit(), which has to check if it is init'd, and then clean up.

I knew someone else who worked at Google. 15-20% was his estimate. Bjarne ran experiments and found overheads approaching that.

There are no comments on this comment yet.