OpenElfTags() - free memory

This forum is for general developer support questions.
Post Reply
softwarefailure
Posts: 104
Joined: Fri Feb 14, 2014 10:29 pm

OpenElfTags() - free memory

Post by softwarefailure »

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()?
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1445
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: OpenElfTags() - free memory

Post by tonyw »

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().
cheers
tony
Post Reply