Re:Complex Car Software Becomes the Weak Spot Under the Hood
by AnimalMuppet on Monday September 28, 2015 @05:23PM
(#10293302)
True, any malloc (or new) and any free (or delete) is non-deterministic (unless you're using a placement allocator). But GC isn't better, because the new still has the same non-determinism, Also, the GC has to do more work than a programmer-controlled delete (walking data structures for liveness, or something approximately equally expensive), and tends to do both the walking and the deletes in bursts. But...
> java creates lots of garbage, C/C++ does not.
Properly written C/C++ does not. Badly written C/C++ creates garbage (leaks memory), and it can never be recovered, because there's no GC. The solution isn't GC, though - it's to pay more attention to who owns the memory.
> java creates lots of garbage, C/C++ does not.
Properly written C/C++ does not. Badly written C/C++ creates garbage (leaks memory), and it can never be recovered, because there's no GC. The solution isn't GC, though - it's to pay more attention to who owns the memory.