Page MenuHomePhabricator

[Support] Allow FileOutputBuffer::create to create an empty file

Authored by MaskRay on Mon, May 4, 10:10 AM.



Size==0 triggers assert(Size != 0) in mapped_file_region::init.
I plan to use an empty file in D79339 (llvm-objcopy --dump-section).

According to POSIX, "If len is zero, mmap() shall fail and no mapping
shall be established." Just specialize case Size=0 to use

Diff Detail

Event Timeline

MaskRay created this revision.Mon, May 4, 10:10 AM
Herald added a project: Restricted Project. · View Herald Transcript
This revision is now accepted and ready to land.Tue, May 5, 12:16 AM
This revision was automatically updated to reflect the committed changes.