4 ms·
Indeed, it isn’t caused by it at all. struct S { int s; }; int *i; { struct S s; i = &s.s; } *i = 7; // and in C++ you can even write in
by epcoa 3y ago
Indeed, it isn’t caused by it at all.
struct S { int s; };
int *i;
{
struct S s;
i = &s.s;
}
*i = 7; // and in C++ you can even write int& j = *i;
No GC or finalizers involved here.
Hope you have ubsan.
The point being that GC is sort of a red herring in the entire discussion. Easily subverted lifetime and ownership semantics are going to be error prone irrespective.