3 ms·
> what happens if you forget to free a pointer in c? Assuming you mean 'forget' to free malloc'd space referenced by at least one pointer, that's an easy one .
by defrost 2y ago
> what happens if you forget to free a pointer in c?
Assuming you mean 'forget' to free malloc'd space referenced by at least one pointer, that's an easy one .. it's reclaimed by the OS when the process ends.
Whether that's a bad thing or not really depends on context - there are entire suites of interlocked processing pipelines built about the notion of allocating required resources, throughputing data, and terminating on completion - no free()'s
- JohnMakin 2y agosurely my salient point is recognized regardless of semantics, but thanks for the correction. To use another example in another post - what happens if you DROP TABLE in sql?
- shermantanktop 2y agoWhat happens is that you call Iron Mountain and find out that those tapes don't actually have anything useful on them.
- fc417fc802 2y agoDROP TABLE is explicit. Inadvertently removing a line from a config file and having Postgres decide to automatically "clean up" that "unneeded table" would be a more apt analogy.