OpenElfTags() - free memory
-
- Posts: 112
- Joined: Fri Feb 14, 2014 10:29 pm
OpenElfTags() - free memory
When using OET_MemoryAddr with OpenElfTags(): Can I free the memory as soon as OpenElfTags() succeeds or do I have to keep the buffer until I call CloseElfTags()?
- tonyw
- AmigaOS Core Developer
- Posts: 1479
- Joined: Wed Mar 09, 2011 1:36 pm
- Location: Sydney, Australia
Re: OpenElfTags() - free memory
Not an expert on this, but reading the docs, I understand it this way:
It depends on whether the ELF image that you provided is likely to be referenced again. Some of the tags provided may allow you to get further information later (eg the DOSHook), and clearly the original ELF image must still be around for that.
In general, you must assume that library calls do NOT copy any offered data unless the docs specifically say so. To be safe, I would assume that you need to preserve the input buffer until you call CloseELF().
It depends on whether the ELF image that you provided is likely to be referenced again. Some of the tags provided may allow you to get further information later (eg the DOSHook), and clearly the original ELF image must still be around for that.
In general, you must assume that library calls do NOT copy any offered data unless the docs specifically say so. To be safe, I would assume that you need to preserve the input buffer until you call CloseELF().
cheers
tony
tony