| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* copyMutableByteArrayNonOverlapping#
* copyAddrToAddr#
* copyAddrToAddrNonOverlapping#
* setAddrRange#
The implementations of copyBytes, moveBytes, and fillBytes
in base:Foreign.Marshal.Utils now use these new primops,
which can cause us to work a bit harder generating code for them,
resulting in the metric increase in T21839c observed by CI on
some architectures. But in exchange, we get better code!
Metric Increase:
T21839c
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`Foreign.Marshal.Pool` used to call `malloc` once for each allocation
request. Each `Pool` maintained a list of allocated pointers, and
traverses the list to `free` each one of those pointers. The extra O(n)
overhead is apparently bad for a `Pool` that serves a lot of small
allocation requests.
This patch uses the RTS internal arena to implement `Pool`, with these
benefits:
- Gets rid of the extra O(n) overhead.
- The RTS arena is simply a bump allocator backed by the block
allocator, each allocation request is likely faster than a libc
`malloc` call.
Closes #14762 #18338.
|
| |
|
|
|
|
|
|
|
|
|
| |
Foreign.Marshal.Array contains many small functions, all of which are
overloaded, and which are critical for performance. Yet none of them
had pragmas, so it was a fluke whether or not they got inlined.
This patch makes them all either INLINE (small ones) or
INLINEABLE and hence specialisable (larger ones).
See Note [Specialising array operations] in that module.
|
| |
|
|
|
|
|
|
|
|
| |
This reverts commit bddecda1a4c96da21e3f5211743ce5e4c78793a2.
This implements the first step in the plan formulated in #20025 to
improve the communication and migration strategy for the proposed
changes to Data.List.
Requires changing the haddock submodule to update the test output.
|
| | |
|
| |
|
|
|
|
|
| |
- Remove GHC.OldList
- Remove Data.OldList
- compat-unqualified-imports is no-op
- update haddock submodule
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
In copyBytes and moveBytes mention which argument is source and which is
destination.
Also fixes some of the crazy indentation in the module and cleans
trailing whitespace.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(use ScopedTypeVariables to remove dummy arguments)
Reviewers: bgamari, RyanGlScott, dfeuer, hvr, monoidal
Reviewed By: monoidal
Subscribers: monoidal, rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5124
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As noted in #14346, touch# may be optimized away when the simplifier can see
that the continuation passed to allocaBytes will not return. Marking CPS-style
functions with NOINLINE ensures that the simplier can't draw any unsound
conclusions.
Ultimately the right solution here will be to do away with touch# and instead
introduce a scoped primitive as is suggested in #14375.
Note: This was present in 8.2 but was never merged to 8.4 in hopes that
we would have #14375 implemented in time. This meant that the issue
regressed again in 8.4. Thankfully we caught it in time to fix it for
8.6.
(cherry picked from commit 404bf05ed3193e918875cd2f6c95ae0da5989be2)
|
| |
|
|
|
|
|
|
|
|
| |
Reviewers: hvr, bgamari, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: RyanGlScott, rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4401
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As it turns out no one actually sets this macro anyways and haddock
now clearly has no trouble parsing this code.
Test Plan: Validate
Reviewers: hvr, goldfire, austin
Reviewed By: austin
Subscribers: duncan, thomie, hvr
Differential Revision: https://phabricator.haskell.org/D1463
|
| | |
|
| |
|
|
|
|
| |
Starting with Haddock 2.16 there's a new built-in support for since-annotations
Note: This exposes a bug in the `@since` implementation (see e.g. `Data.Bits`)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This adds zero-initialising versions of `malloc{,Bytes,Array,Array0}`
* Add `calloc` and `callocBytes` to `Foreign.Marshal.Alloc`.
* Add `callocArray` and `callocArray0` to `Foreign.Marshal.Array`.
Reviewers: ekmett, duncan, austin, hvr
Reviewed By: austin, hvr
Subscribers: ezyang, simonmar, ekmett, duncan, thomie, carter
Projects: #ghc
Differential Revision: https://phabricator.haskell.org/D527
GHC Trac Issues: #9859
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
fillBytes uses 'memset' to fill a memory area with a given byte value.
Reviewed By: austin, hvr
Differential Revision: https://phabricator.haskell.org/D465
|
| |
|
|
| |
...several modules in `base` recently touched by me
|
| |
|
|
|
|
| |
This is preparatory refactoring for avoiding import cycles
when `Data.Traversable` will be imported by `Control.Monad` and
`Data.List` for implementing #9586
|
| |
|
|
|
|
|
|
|
| |
This allows several modules to avoid importing Control.Monad and thus break
import cycles that manifest themselves when implementing #9586
Reviewed By: austin, ekmett
Differential Revision: https://phabricator.haskell.org/D222
|
| |
|
|
|
|
|
|
|
|
|
| |
This fixes the markup at the top of `Control.Arrow`, and improves the
markup inside DEPRECATED strings.
(Haddock supports markup inside DEPRECATED messages, which allows to
turn references to Haskell entities into hyperlinks by using the usual
Haddock markup.)
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This removes language pragmas from Haskell modules which are implicitly
active with `default-language: Haskell2010`. Specifically, the following
language extension pragmas are removed by this commit:
- PatternGuards
- ForeignFunctionInterface
- EmptyDataDecls
- NoBangPatterns
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
| |
|
|
|
|
|
|
|
|
| |
Now that HUGS and NHC specific code has been removed, this commit "folds"
the now redundant `#if((n)def)`s containing `__GLASGOW_HASKELL__`. This
renders `base` officially GHC only.
This commit also removes redundant `{-# LANGUAGE CPP #-}`.
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
| |
|
|
|
|
|
| |
For rationale. see
http://permalink.gmane.org/gmane.comp.lang.haskell.ghc.devel/2349
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Do not have have an hs-boot file for Data.Typeable
* Instead make all the loops go through
GHC.Err (just a couple of magic functions)
GHC.Exception (some non-exceptional functions)
The main idea is
a) don't involve classes in the hs-boot world
b) loop through error cases where performance doesn't matter
c) be careful not to SOURCE import things that are bottom,
unless MkCore knows about them in eRROR_IDS, so that we
see their strictness
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These comments are rather less useful now that haddock can give docs
with the same informatino in the module synopsis.
Having to maintain them when making changes to the library is a pain,
and when people forget about doing so there is nothing that checks that
the comments are right, so mistakes tend to linger.
Of the comments that my script detected, 78 of 684 were already
incorrect in one way or another, e.g. missing context:
Text.Show.showsPrec
Comment type: Int -> a -> ShowS
Actual type: Show a => Int -> a -> ShowS
wrong context:
Numeric.readInt
Comment type: Integral a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a
Actual type: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a
not following a class change (e.g. Num losing its Eq superclass):
Text.Read.Lex.readOctP
Comment type: Num a => ReadP a
Actual type: (Eq a, Num a) => ReadP a
not following the Exceptions change:
GHC.Conc.childHandler
Comment type: Exception -> IO ()
Actual type: SomeException -> IO ()
or just always been wrong:
GHC.Stable.deRefStablePtr
Comment type: StablePtr a -> a
Actual type: StablePtr a -> IO a
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Part of trac #5529. We also now import the constructors in various
modules that use them in FFI decls.
|
| | |
|
| |
|
|
|
|
| |
unsafePerformIO. The latter is more efficient, and will work
correctly for clients that are using unsafeLocalState for its
documented uses.
|
| | |
|
| |
|
|
| |
Based on a patch from Jason Dagit
|
| |
|
|
|
|
|
| |
git conversion of:
Tue Mar 8 22:31:07 CET 2011 Bas van Dijk <v.dijk.bas@gmail.com>
* Generalize the type of Foreign.Marshal.Utils.maybeNew
This makes it consistent with maybeWith
|
| |
|
|
|
|
|
|
|
|
| |
Add explicit {-# LANGUAGE xxx #-} pragmas to each module, that say
what extensions that module uses. This makes it clearer where
different extensions are used in the (large, variagated) base package.
Now base.cabal doesn't need any extensions field
Thanks to Bas van Dijk for doing all the work.
|
| |
|
|
| |
RebindableSyntax
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As discussed on the libraries/haskell-cafe mailing lists
http://www.haskell.org/pipermail/libraries/2010-April/013420.html
This is a replacement for block/unblock in the asychronous exceptions
API to fix a problem whereby a function could unblock asynchronous
exceptions even if called within a blocked context.
The new terminology is "mask" rather than "block" (to avoid confusion
due to overloaded meanings of the latter).
The following is the new API; the old API is deprecated but still
available for the time being.
Control.Exception
-----------------
mask :: ((forall a. IO a -> IO a) -> IO b) -> IO b
mask_ :: IO a -> IO a
uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b
uninterruptibleMask_ :: IO a -> IO
getMaskingState :: IO MaskingState
data MaskingState
= Unmasked
| MaskedInterruptible
| MaskedUninterruptible
Control.Concurrent
------------------
forkIOUnmasked :: IO () -> IO ThreadId
|
| | |
|