summary refs log tree commit diff stats
path: root/nimpretty/nimpretty.nim.cfg
diff options
context:
space:
mode:
authorc-blake <c-blake@users.noreply.github.com>2024-06-14 06:23:26 +0000
committerGitHub <noreply@github.com>2024-06-14 08:23:26 +0200
commit8037bbe327ec581fbafd558bf1eb4619d373e7ec (patch)
tree472621bad9ca0fec89f70f3549ed7ce81fbd932f /nimpretty/nimpretty.nim.cfg
parent0b5a938f571133f6e876938387e37199d4c2ec16 (diff)
downloadNim-8037bbe327ec581fbafd558bf1eb4619d373e7ec.tar.gz
Fix non-exported `memfiles.setFileSize` to be able to shrink files on posix via `memfiles.resize` (#23717)
Fix non-exported `setFileSize` to take optional `oldSize` to (on posix)
shrink differently than it grows (`ftruncate` not `posix_fallocate`)
since it makes sense to assume the higher address space has already been
allocated there and include the old file size in the `proc resize` call.
Also, do not even try `setFileSize` in the first place unless the `open`
itself works by moving the call into the `if newFileSize != -1` branch.

Just cosmetics, also improve some old 2011 comments, note a logic diff
for callers using both `mappedSize` & `newFileSize` from windows branch
in case someone wants to fix that & simplify code formatting a little.
Diffstat (limited to 'nimpretty/nimpretty.nim.cfg')
0 files changed, 0 insertions, 0 deletions