authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2019-08-04 16:27:36+10:00
committergravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2019-08-04 16:27:36+10:00
log887eac0219345763f1ae9c8d9efad6950f6bbfe6
tree181b5e8e8849fbceebe37246c1d3d3471a3720e5
parent521aaf350185b5f01816b7a9ec604335edb3ac16
signaturelock-open Commit is signed but in an unrecognized format.

std: remove elf.auto_close_stream and elf.prealloc_file


1 files changed, 0 insertions(+), 5 deletions(-)

std/elf.zig-5
...@@ -356,7 +356,6 @@ pub const SectionHeader = struct {...@@ -356,7 +356,6 @@ pub const SectionHeader = struct {
356pub const Elf = struct {356pub const Elf = struct {
357 seekable_stream: *io.SeekableStream(anyerror, anyerror),357 seekable_stream: *io.SeekableStream(anyerror, anyerror),
358 in_stream: *io.InStream(anyerror),358 in_stream: *io.InStream(anyerror),
359 auto_close_stream: bool,
360 is_64: bool,359 is_64: bool,
361 endian: builtin.Endian,360 endian: builtin.Endian,
362 file_type: FileType,361 file_type: FileType,
...@@ -368,7 +367,6 @@ pub const Elf = struct {...@@ -368,7 +367,6 @@ pub const Elf = struct {
368 string_section: *SectionHeader,367 string_section: *SectionHeader,
369 section_headers: []SectionHeader,368 section_headers: []SectionHeader,
370 allocator: *mem.Allocator,369 allocator: *mem.Allocator,
371 prealloc_file: File,
372370
373 /// Call close when done.371 /// Call close when done.
374 pub fn openPath(allocator: *mem.Allocator, path: []const u8) !Elf {372 pub fn openPath(allocator: *mem.Allocator, path: []const u8) !Elf {
...@@ -386,7 +384,6 @@ pub const Elf = struct {...@@ -386,7 +384,6 @@ pub const Elf = struct {
386 in: *io.InStream(anyerror),384 in: *io.InStream(anyerror),
387 ) !Elf {385 ) !Elf {
388 var elf: Elf = undefined;386 var elf: Elf = undefined;
389 elf.auto_close_stream = false;
390 elf.allocator = allocator;387 elf.allocator = allocator;
391 elf.seekable_stream = seekable_stream;388 elf.seekable_stream = seekable_stream;
392 elf.in_stream = in;389 elf.in_stream = in;
...@@ -529,8 +526,6 @@ pub const Elf = struct {...@@ -529,8 +526,6 @@ pub const Elf = struct {
529526
530 pub fn close(elf: *Elf) void {527 pub fn close(elf: *Elf) void {
531 elf.allocator.free(elf.section_headers);528 elf.allocator.free(elf.section_headers);
532
533 if (elf.auto_close_stream) elf.prealloc_file.close();
534 }529 }
535530
536 pub fn findSection(elf: *Elf, name: []const u8) !?*SectionHeader {531 pub fn findSection(elf: *Elf, name: []const u8) !?*SectionHeader {