Skip to content
Snippets Groups Projects
  1. Nov 24, 2022
    • Matthew Pickering's avatar
      notes: Fix references to HPT space leak note · 11627c42
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      Updating this note was missed when updating the HPT to the HUG.
      
      Fixes #22477
      11627c42
    • Vladislav Zavialov's avatar
      Check if the SDoc starts with a single quote (#22488) · 178c1fd8
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This patch fixes pretty-printing of character literals
      inside promoted lists and tuples.
      
      When we pretty-print a promoted list or tuple whose first element
      starts with a single quote, we want to add a space between the opening
      bracket and the element:
      
      	'[True]    -- ok
      	'[ 'True]  -- ok
      	'['True]   -- not ok
      
      If we don't add the space, we accidentally produce a character
      literal '['.
      
      Before this patch, pprSpaceIfPromotedTyCon inspected the type as an AST
      and tried to guess if it would be rendered with a single quote. However,
      it missed the case when the inner type was itself a character literal:
      
      	'[ 'x']  -- ok
      	'['x']   -- not ok
      
      Instead of adding this particular case, I opted for a more future-proof
      solution: check the SDoc directly. This way we can detect if the single
      quote is actually there instead of trying to predict it from the AST.
      The new function is called spaceIfSingleQuote.
      178c1fd8
    • M Farkas-Dyck's avatar
      Scrub some no-warning pragmas. · 040bfdc3
      M Farkas-Dyck authored and Marge Bot's avatar Marge Bot committed
      040bfdc3
  2. Nov 23, 2022
  3. Nov 22, 2022
    • Jonathan Dowland's avatar
      utils/unlit: adjust parser to match Report spec · e817c871
      Jonathan Dowland authored and Marge Bot's avatar Marge Bot committed
      The Haskell 2010 Report says that, for Latex-style Literate format,
      "Program code begins on the first line following a line that begins
      \begin{code}". (This is unchanged from the 98 Report)
      
      However the unlit.c implementation only matches a line that contains
      "\begin{code}" and nothing else. One consequence of this is that one
      cannot suffix Latex options to the code environment. I.e., this does
      not work:
      
      \begin{code}[label=foo,caption=Foo Code]
      
      Adjust the matcher to conform to the specification from the Report.
      
      The Haskell Wiki currently recommends suffixing a '%' to \begin{code}
      in order to deliberately hide a code block from Haskell. This is bad
      advice, as it's relying on an implementation quirk rather than specified
      behaviour. None-the-less, some people have tried to use it, c.f.
      <https://mail.haskell.org/pipermail/haskell-cafe/2009-September/066780.html>
      
      An alternative solution is to define a separate, equivalent Latex
      environment to "code", that is functionally identical in Latex but
      ignored by unlit. This should not be a burden: users are required to
      manually define the code environment anyway, as it is not provided
      by the Latex verbatim or lstlistings packages usually used for
      presenting code in documents.
      
      Fixes #3549.
      e817c871
    • Oleg Grenrus's avatar
      Add unsafePtrEquality# restricted to UnliftedTypes · 9d61c182
      Oleg Grenrus authored and Marge Bot's avatar Marge Bot committed
      9d61c182
    • Andreas Klebinger's avatar
      hadrian:Set TNTC when running testsuite. · de5fb348
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      de5fb348
    • Andreas Klebinger's avatar
      Optimize getLevity. · e5b68183
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      Avoid the intermediate data structures allocated by splitTyConApp.
      This avoids ~0.5% of allocations for a build using -O2.
      
      Fixes #22254
      e5b68183
    • Duncan Coutts's avatar
      Reveiew feedback: improve one of the TODO comments · 7181b074
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      The one about the nonsense (const False) test on WinIO for there being any IO
      or timers pending, leading to unnecessary complication later in the
      scheduler.
      7181b074
    • Duncan Coutts's avatar
      Pass the Capability *cap explicitly to appendToIOBlockedQueue · 667fe5a4
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      And to insertIntoSleepingQueue. Again, it's a bit cleaner and simpler
      though not strictly necessary given that these primops are currently
      only used in the non-threaded RTS.
      667fe5a4
    • Duncan Coutts's avatar
      Pass the Capability *cap explicitly to awaitEvent · 054dcc9d
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      It is currently only used in the non-threaded RTS so it works to use
      MainCapability, but it's a bit nicer to pass the cap anyway. It's
      certainly shorter.
      054dcc9d
    • Duncan Coutts's avatar
      Move the awaitEvent declaration into IOManager.h · 9943baf9
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      And add or adjust comments at the use sites of awaitEvent.
      9943baf9
    • Duncan Coutts's avatar
      Expand emptyThreadQueues inline for clarity · 32946220
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      It was not really adding anything. The name no longer meant anything
      since those I/O and timeout queues do not belong to the scheuler.
      
      In one of the two places it was used, the comments already had to
      explain what it did, whereas now the code matches the comment nicely.
      32946220
    • Duncan Coutts's avatar
      Replace EMPTY_{BLOCKED,SLEEPING}_QUEUE macros by function · 664b034b
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      These are the macros originaly from Scheduler.h, previously moved to
      IOManager.h, and now replaced with a single inline function
      anyPendingTimeoutsOrIO(). We can use a single function since the two
      macros were always checked together.
      
      Note that since anyPendingTimeoutsOrIO is defined for all IO manager
      cases, including threaded, we do not need to guard its use by cpp
       #if !defined(THREADED_RTS)
      664b034b
    • Duncan Coutts's avatar
      Move macros for checking for pending IO or timers · 39a91f60
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      from Schedule.h to Schedule.c and IOManager.h
      
      This is just moving, the next step will be to rejig them slightly.
      
      For the non-threaded RTS the scheduler needs to be able to test for
      there being pending I/O operation or pending timers. The implementation
      of these tests should really be considered to be part of the I/O
      managers and not part of the scheduler.
      39a91f60
    • Duncan Coutts's avatar
      Remove the now-unused markScheduler · 0f68919e
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      The global vars {blocked,sleeping}_queue are now in the Capability and
      so get marked there via markCapabilityIOManager.
      0f68919e
    • Duncan Coutts's avatar
      Move {blocked,sleeping}_queue from scheduler global vars to CapIOManager · ced9acdb
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      The blocked_queue_{hd,tl} and the sleeping_queue are currently
      cooperatively managed between the scheduler and (some but not all of)
      the non-threaded I/O manager implementations.
      
      They lived as global vars with the scheduler, but are poked by I/O
      primops and the I/O manager backends.
      
      This patch is a step on the path towards making the management of I/O or
      timer blocking belong to the I/O managers and not the scheduler.
      
      Specifically, this patch moves the {blocked,sleeping}_queue from being
      global vars in the scheduler to being members of the CapIOManager struct
      within each Capability. They are not yet exclusively used by the I/O
      managers: they are still poked from a couple other places, notably in
      the scheduler before calling awaitEvent.
      ced9acdb
    • Duncan Coutts's avatar
      Move APPEND_TO_BLOCKED_QUEUE from cmm to C · 5cf709c5
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      The I/O and delay blocking primitives for the non-threaded way
      currently access the blocked_queue and sleeping_queue directly.
      
      We want to move where those queues are to make their ownership clearer:
      to have them clearly belong to the I/O manager impls rather than to the
      scheduler. Ultimately we will want to change their representation too.
      
      It's inconvenient to do that if these queues are accessed directly from
      cmm code. So as a first step, replace the APPEND_TO_BLOCKED_QUEUE with a
      C version appendToIOBlockedQueue(), and replace the open-coded
      sleeping_queue insertion with insertIntoSleepingQueue().
      5cf709c5
    • Duncan Coutts's avatar
      Add hook markCapabilityIOManager · 8901285e
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      To allow I/O managers to have GC roots in the Capability, within the
      CapIOManager structure.
      
      Not yet used in this patch.
      8901285e
    • Duncan Coutts's avatar
      Introduce CapIOManager as the per-cap I/O mangager state · 8d6aaa49
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      Rather than each I/O manager adding things into the Capability structure
      ad-hoc, we should have a common CapIOManager iomgr member of the
      Capability structure, with a common interface to initialise etc.
      
      The content of the CapIOManager struct will be defined differently for
      each I/O manager implementation. Eventually we should be able to have
      the CapIOManager be opaque to the rest of the RTS, and known just to the
      I/O manager implementation. We plan for that by making the Capability
      contain a pointer to the CapIOManager rather than containing the
      structure directly.
      
      Initially just move the Unix threaded I/O manager's control FD.
      8d6aaa49
  4. Nov 20, 2022
  5. Nov 19, 2022
  6. Nov 16, 2022
  7. Nov 15, 2022
  8. Nov 14, 2022
Loading