News for hackers. Stuff that matters.
Re:The Best C++ Interview Question – Ever by onewland on Monday December 07, 2009 @06:41PM (#982543)
This feels like kind of a cheap answer, but I know that with Visual Studio you can step into most standard library functions, even if it ends up being at the assembly level; I assume the same is true for gdb.

Is the not asshole answer to be stopping right before the malloc and taking note of memory consumption and determining how much malloc is trying to allocate?

Re:The Best C++ Interview Question – Ever by tptacek on Monday December 07, 2009 @06:57PM (#982576)
Stepping through malloc isn't going to help you much in this case. But most people I've met that have written a lot of C/C++ code have seen this bug at least once.

When you start asking about how much memory malloc is asking for, that's a tip-off in the wrong direction for me too; malloc handles "out of memory" pretty gracefully.