I think the AI got this wrong

Using odin language I was searching for how to remove an item from a map in odin and the AI unprompted told me this. It’s just plain wrong, right?

I know… never use an AI for anything… I didn’t want it to but search does it for you these days :(

“In Odin, when a map has dynamic arrays as values, simply removing the key with delete_key ensures the dynamic array’s memory is properly freed. Dynamic arrays in Odin manage their own memory and store an allocator; when delete_key removes the key, the map system automatically cleans up the associated dynamic array using its allocator, preventing memory leaks. This works because the map understands how to destruct complex values like dynamic arrays. If you don’t use delete_key, the key-value pair remains, and the dynamic array’s memory isn’t released, leading to a leak—especially critical in long-running applications like games where such leaks accumulate over time.”

I would be very suprised if this was true. You always need to manually free things in Odin as far as I know. I tried it out and confirmed my suspicians that this is simply wrong.

AI can be useful but do not trust it!