std: remove elf.auto_close_stream and elf.prealloc_file

master
daurnimator 2019-08-04 16:27:36 +10:00
parent 521aaf3501
commit 887eac0219
No known key found for this signature in database
GPG Key ID: 45B429A8F9D9D22A
1 changed files with 0 additions and 5 deletions

View File

@ -356,7 +356,6 @@ pub const SectionHeader = struct {
pub const Elf = struct {
seekable_stream: *io.SeekableStream(anyerror, anyerror),
in_stream: *io.InStream(anyerror),
auto_close_stream: bool,
is_64: bool,
endian: builtin.Endian,
file_type: FileType,
@ -368,7 +367,6 @@ pub const Elf = struct {
string_section: *SectionHeader,
section_headers: []SectionHeader,
allocator: *mem.Allocator,
prealloc_file: File,
/// Call close when done.
pub fn openPath(allocator: *mem.Allocator, path: []const u8) !Elf {
@ -386,7 +384,6 @@ pub const Elf = struct {
in: *io.InStream(anyerror),
) !Elf {
var elf: Elf = undefined;
elf.auto_close_stream = false;
elf.allocator = allocator;
elf.seekable_stream = seekable_stream;
elf.in_stream = in;
@ -529,8 +526,6 @@ pub const Elf = struct {
pub fn close(elf: *Elf) void {
elf.allocator.free(elf.section_headers);
if (elf.auto_close_stream) elf.prealloc_file.close();
}
pub fn findSection(elf: *Elf, name: []const u8) !?*SectionHeader {