summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-02-19 20:15:26 -0500
committerTavian Barnes <tavianator@tavianator.com>2016-02-19 20:15:26 -0500
commit8ac7f4f334668a9ad966f36bcf125e1b7652af80 (patch)
treea5e37b07e215aecc2dda5e1f70892d5cda304381 /parse.c
parentcf9fd80ece99d69cc809daf75f53705dbf64ea0e (diff)
downloadbfs-8ac7f4f334668a9ad966f36bcf125e1b7652af80.tar.xz
bftw: Don't keep DIR*'s around.
DIR*'s were being kept around so dirfd(dir) could be passed to future openat() calls. But DIR*'s are big, holding a cache of filenames etc. read by readdir(). Instead, store the raw fd and dup() it to open a DIR* with fdopendir(). This way we can call dirclose() as soon as possible, while still keeping an open fd. Ideally there would be a way to closedir() without invoking close() on the underlying fd, but this is a good approximation. Reduces memory footprint by around 64% in a large directory tree.
Diffstat (limited to 'parse.c')
0 files changed, 0 insertions, 0 deletions