[flang-commits] [PATCH] D120685: [flang] Allow more concurrently open NEWUNIT= values, with recycling

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Feb 28 14:01:28 PST 2022


klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added subscribers: jdoerfert, mgorny.
Herald added a reviewer: sscalpone.
klausler requested review of this revision.

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.


https://reviews.llvm.org/D120685

Files:
  flang/include/flang/Common/fast-int-set.h
  flang/runtime/io-api.cpp
  flang/runtime/tools.h
  flang/runtime/unit-map.cpp
  flang/runtime/unit-map.h
  flang/unittests/CMakeLists.txt
  flang/unittests/Common/CMakeLists.txt
  flang/unittests/Common/FastIntSetTest.cpp
  flang/unittests/Runtime/BufferTest.cpp
  flang/unittests/Runtime/CharacterTest.cpp
  flang/unittests/Runtime/CommandTest.cpp
  flang/unittests/Runtime/CrashHandlerFixture.cpp
  flang/unittests/Runtime/CrashHandlerFixture.h
  flang/unittests/Runtime/Format.cpp
  flang/unittests/Runtime/Inquiry.cpp
  flang/unittests/Runtime/ListInputTest.cpp
  flang/unittests/Runtime/Matmul.cpp
  flang/unittests/Runtime/MiscIntrinsic.cpp
  flang/unittests/Runtime/Namelist.cpp
  flang/unittests/Runtime/Numeric.cpp
  flang/unittests/Runtime/NumericalFormatTest.cpp
  flang/unittests/Runtime/Random.cpp
  flang/unittests/Runtime/Reduction.cpp
  flang/unittests/Runtime/RuntimeCrashTest.cpp
  flang/unittests/Runtime/Time.cpp
  flang/unittests/Runtime/Transformational.cpp
  flang/unittests/Runtime/tools.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120685.411890.patch
Type: text/x-patch
Size: 22133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220228/8f9b1ea1/attachment-0001.bin>


More information about the flang-commits mailing list