mirror of
https://github.com/serge1/ELFIO.git
synced 2024-12-26 18:15:40 +00:00
Add segment free_data function
Allow for segment data to be freed to allow for reduced memory usage when dealing with large elf segments.
This commit is contained in:
parent
73a241079a
commit
23527bd291
@ -48,6 +48,7 @@ class segment
|
||||
ELFIO_GET_ACCESS_DECL( Elf64_Off, offset );
|
||||
|
||||
virtual const char* get_data() const = 0;
|
||||
virtual void free_data() const = 0;
|
||||
|
||||
virtual Elf_Half add_section( section* psec, Elf_Xword addr_align ) = 0;
|
||||
virtual Elf_Half add_section_index( Elf_Half index,
|
||||
@ -104,6 +105,12 @@ template <class T> class segment_impl : public segment
|
||||
return data.get();
|
||||
}
|
||||
|
||||
void free_data() const override
|
||||
{
|
||||
data.reset(nullptr);
|
||||
is_lazy = true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
Elf_Half add_section_index( Elf_Half sec_index,
|
||||
Elf_Xword addr_align ) override
|
||||
|
Loading…
Reference in New Issue
Block a user