I
Ian Collins
Standard library containers either use a default allocator, or oneJon said:The STL does a lot of magic inside its black box in order to improve
performance, using custom allocators. The time they take to execute is
unpredictable. So I'm saying that GC is no worse than that. IME, GC can be
significantly better for worst case (OCaml vs STL).
provided by the user. Either of these can be characterised. There's
nothing to stop the user providing a garbage collected allocator...
But you still have to surround the function statements with aIn the C++, the destructor is called as the exception handler unwinds past
the scope. In the ML, the finally clause is called as the exception handler
unwinds past the cope. So both approaches release the lock when an
exception is thrown. There isn't really much difference between the two.
try-finally block, or am I missing something?