This is an archive of the discontinued LLVM Phabricator instance.

[flang] Allow more concurrently open NEWUNIT= values, with recycling
ClosedPublic

Authored by klausler on Feb 28 2022, 2:01 PM.

Details

Summary

Add a header-only implementation of Briggs & Torczon's fast small
integer set data structure to flang/include/flang/Common, and use
it in the runtime to manage a pool of Fortran unit numbers with
recycling. This replaces the bit set previously used for that
purpose. The set is initialized on demand with the negations of
all the NEWUNIT= unit numbers that can be returned to any kind
of integer variable.

For programs that require more concurrently open NEWUNIT= unit
numbers than the pool can hold, they are now allocated with a
non-recycling counter. This allows as many open units as the
operating system provides.

Many of the top-line comments in flang/unittests/Runtime had the
wrong path name. I noticed this while adding a unit test for the
fast integer set data structure, and cleaned them up.

Diff Detail

Event Timeline

klausler created this revision.Feb 28 2022, 2:01 PM
klausler requested review of this revision.Feb 28 2022, 2:01 PM
vdonaldson accepted this revision.Feb 28 2022, 2:21 PM
This revision is now accepted and ready to land.Feb 28 2022, 2:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2022, 4:13 PM