file: improve the file access interface
commitd81a235f33e78ef6b942788b42db073ed51fa801
authorH. Peter Anvin <hpa@linux.intel.com>
Wed, 21 Sep 2016 21:03:18 +0000 (21 14:03 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Wed, 21 Sep 2016 21:07:17 +0000 (21 14:07 -0700)
tree595f64bc54b7a9ca68ee44dd7f33909afa40083c
parentc170089e7cfd876b61c5d110df04989696c25fc6
file: improve the file access interface

A number of fairly common operations are invoked way too many times,
especially when using incbin.  Drastically reduce the number of system
calls that need to be executed, and use memory mapping to reduce
unnecessary double buffering.

We could improve this further by leaving files open once used;
however, that might run into file count problems on some systems.

Still unclear is why we seem to invoke nasm_file_size() twice per pass
for incbin.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
asm/assemble.c
asm/preproc.c
configure.ac
include/nasmlib.h
nasmlib/file.c
test/incbin.asm [new file with mode: 0644]
test/incbin.data [new file with mode: 0644]