News for hackers. Stuff that matters.
Re:Memory Safety in Rust: A Case Study with C by reza_n on Saturday February 03, 2018 @11:45AM (#16298291)
As another poster pointed out, if I run this via valgrind (after fixing the first error):

  > valgrind ./a.out

  ==4871== Invalid write of size 4
  ==4871==    at 0x40073A: vec_push (test.c:40)

  ==4871== Invalid write of size 4
  ==4871==    at 0x40073A: vec_push (test.c:40)

  ==4871== Invalid read of size 4
  ==4871==    at 0x4007CD: main (test.c:55)

  ==4871== Invalid read of size 8
  ==4871==    at 0x400769: vec_free (test.c:46)

  ==4871== Invalid free() / delete / delete[] / realloc()
  ==4871==    at 0x4C2BDEC: free (...)
  ==4871==    by 0x400770: vec_free (test.c:46)

There are no comments on this comment yet.