D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21523 - Microsoft Windows std.stdio.File.lock(), tryLock(), unlock(): do not allocate memory for error messages when they are not needed
Summary: Microsoft Windows std.stdio.File.lock(), tryLock(), unlock(): do not allocate...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All Windows
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-01-04 01:08 UTC by Nathan S.
Modified: 2021-01-04 03:55 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nathan S. 2021-01-04 01:08:48 UTC
The non-Windows paths use `errnoEnforce` that lazily evaluates the messages. The Windows path uses a private function `wenforce` that evaluates its arguments eagerly.
Comment 1 Dlang Bot 2021-01-04 01:15:50 UTC
@n8sh created dlang/phobos pull request #7740 "Microsoft Windows std.stdio.File.lock(), tryLock(),  unlock(): do not allocate memory for error messages when they are not needed" fixing this issue:

- Fix Issue 21523 - Microsoft Windows std.stdio.File.lock(), tryLock(), unlock(): do not allocate memory for error messages when they are not needed

https://github.com/dlang/phobos/pull/7740
Comment 2 Dlang Bot 2021-01-04 03:55:30 UTC
dlang/phobos pull request #7740 "Microsoft Windows std.stdio.File.lock(), tryLock(),  unlock(): do not allocate memory for error messages when they are not needed" was merged into master:

- 5aeaa1f873f5c0d04d27816466960d298503491b by Nathan Sashihara:
  Fix Issue 21523 - Microsoft Windows std.stdio.File.lock(), tryLock(), unlock(): do not allocate memory for error messages when they are not needed

https://github.com/dlang/phobos/pull/7740