incbin: if we have to fread(), try to do it only once...
commit04445364fc9123ad40bf5581ffa4c5afac4c57dc
authorH. Peter Anvin <hpa@linux.intel.com>
Wed, 21 Sep 2016 22:56:19 +0000 (21 15:56 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Wed, 21 Sep 2016 22:56:19 +0000 (21 15:56 -0700)
tree127577894550f7f99518de1e030cbefe4f8fa08b
parentd81a235f33e78ef6b942788b42db073ed51fa801
incbin: if we have to fread(), try to do it only once...

If we can't mmap a file and instead have to fread(), if the data is
small enough that we can reasonably accomodate it in a memory buffer,
then just read it once.

It seems rather unlikely that very large files would be used with
TIMES anyway.

Also note: the previous comment about nasm_file_size[_by_path]() being
invoked twice was spurious; it does not actually happen.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
asm/assemble.c
include/nasmlib.h
test/incbin.asm