Finally I have a valid reason to learn about memory management. It was also hella weird when encountering it.

  • Die Martin Die@sh.itjust.works
    link
    fedilink
    arrow-up
    5
    ·
    2 days ago

    It’ll be fun when you get to funny errors because you used freed memory.

    When I was learning about linked lists and decided to use them in a project, I “removed” items by making the previous item’s next point to this item’s next, except I misplaced a call to free before using the fields, and it somehow still worked most of the time on debug builds, but on optimized builds it would cause a segmentation fault 100% of the time.