9 Commits

Author SHA1 Message Date
Tony Parker
39344d7f61
Reduce number of read calls when not asking for progress reporting. (#623)
* Reduce number of read calls when not asking for progress reporting.

Also, when asking for progress reporting, cap the number of updates at approximately 100 instead of fileSize/4k.

* Add readUntilEOF option to file reading primitive and set it to true by default

* Address review comments - change readUntilEOF to readUntilLength
2024-05-23 14:36:07 -07:00
Tony Parker
65c6532a8e
See if String(contentsOf:) family can be implemented directly in Swift (#622) 2024-05-20 11:16:56 -07:00
Saleem Abdulrasool
ed2f5405d9
FoundationEssentials: correct memory mapping on Windows (#591)
We were using the wrong buffer when creating the result, forming the
wrong deallocation for the buffer. Remove the unnecessary mapping and
correct the buffer usage to prevent a cross-domain free of the data.
2024-05-07 13:24:22 -07:00
Saleem Abdulrasool
a76eaee9cd
(127616644) FoundationEssentials: support mmap'ed reading on Windows (#527)
This adjusts the data reading path for supporting Windows which does not
have the `mmap` function but does provide memory-mapped IO. The
difference in the API is sufficient to create a separate path for the
wrapping function rather than trying to have a single shared
implementation that simply uses different APIs for the system
integration.
2024-05-06 15:13:17 -07:00
Saleem Abdulrasool
3e4077fcaf
FoundationEssentials: clean up some Windows warnings (#571)
Use the Windows POSIX API spellings to avoid the warnings. Take the
opportunity to change the environment handling to ensure that we are
able to handle weird unicode environment variables which may not be
rendered properly in the ASCII environment representation. Adjust some
types to better match the implementation on Windows which is a minor uop
to avoid unnecessary `trunc` and `sext` or `zext`.
2024-05-01 13:40:29 -07:00
Saleem Abdulrasool
9491cce69c
FoundationEssentials: add some missing imports for Windows (#520)
This allows us to get further into building FoundationEssentials once
again on Windows. Much of the file system work has resulted in this
module no longer being viable on Windows and will need to be replaced to
allow building on Windows which does not have the `fts` APIs.
2024-03-29 14:19:23 -07:00
Jeremy Schonfeld
e5211f2926
(122981400) Standardize on using internal import 2024-03-06 13:42:02 -08:00
Jeremy Schonfeld
12d6069721
(123104044) Consolidate/standardize file-based error reporting
* Consolidate/standardize file-based error reporting

* Fix build failures

* Fix test failures
2024-02-16 16:50:16 -08:00
Tony Parker
4499edd7b1
Implement Data reading and writing (#377)
* Implement Data reading and writing

* Use swift-foundation-local for dependency name in benchmark
2024-01-17 13:04:41 -08:00