Commit 887eac0219

daurnimator <quae@daurnimator.com>
2019-08-04 08:27:36
std: remove elf.auto_close_stream and elf.prealloc_file
1 parent 521aaf3
Changed files (1)
std/elf.zig
@@ -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 {