Skip to content

Commit

Permalink
More code cleanup after Drew's changes.
Browse files Browse the repository at this point in the history
Removed all code that added support for GHC < 9.4.
Updated changelog.
  • Loading branch information
brianjosephmckeon committed Feb 28, 2024
1 parent 11f4ee0 commit e4722bc
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 700 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ added, changed, deprecated, etc. subsections.

This project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/).

## 0.7.2.0 -- 2024-02-05
## 0.7.2.0 -- 2024-02-28

- Add `socket` as alias for `uninterruptibleSocket`.
- Add `withSocket`.
- Removed `UNLIFTEDARRAYFUNCTIONS` flag and support for GHC < 9.4.

## 0.7.1.0 -- 2023-10-03

Expand Down
3 changes: 1 addition & 2 deletions posix-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ test-suite test
build-depends:
, base
, posix-api
, primitive >=0.7
, primitive-unlifted
, primitive >=0.7
, tasty
, tasty-hunit

Expand Down
3 changes: 0 additions & 3 deletions src-assertions/Assertion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ module Assertion
, assertMutablePrimArrayPinned
) where

import GHC.Exts (isTrue#)

import qualified Data.Primitive as PM
import qualified GHC.Exts as Exts

assertMutablePrimArrayPinned :: PM.MutablePrimArray s a -> PM.MutablePrimArray s a
assertMutablePrimArrayPinned x =
Expand Down
3 changes: 0 additions & 3 deletions src/Linux/Epoll.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ module Linux.Epoll
, T.peekEventDataU32
, T.peekEventDataU64
, T.pokeEventDataU64
-- , T.readEventDataU64
-- , T.writeEventDataU64
-- , T.writeEventEvents
) where

import Prelude hiding (error)
Expand Down
29 changes: 1 addition & 28 deletions src/Linux/Epoll/Types.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{-# language PolyKinds #-}
{-# language ScopedTypeVariables #-}
{-# language TypeApplications #-}
{-# language TypeInType #-}
{-# language DataKinds #-}
{-# language UnboxedTuples #-}

-- This is needed because hsc2hs does not currently handle ticked
Expand Down Expand Up @@ -334,30 +334,3 @@ word64ToWord32 = fromIntegral

unI :: Int -> Int##
unI (I## i) = i

-- -- | Read @data.u64@ from @struct epoll_event@.
-- readEventDataU64 ::
-- MutableByteArray RealWorld
-- -> Int -- ^ Index. Elements are @struct epoll_event@.
-- -> IO Word64
-- readEventDataU64 !arr !ix = do
-- -- On 64-bit platforms, Linux bitpacks this structure, causing the
-- -- data (a 64-bit word) to be misaligned. Consequently, we must
-- -- hardcode the assumed offsets to perform only aligned accesses.
-- -- The behavior is deterministic across platforms of different
-- -- endianness only if the only use of this function is paired with
-- -- writeEventDataU64.
-- (a :: Word32) <- PM.readByteArray arr (ix * 3 + 1)
-- (b :: Word32) <- PM.readByteArray arr (ix * 3 + 2)
-- pure (unsafeShiftL (word32ToWord64 a) 32 .|. word32ToWord64 b)
--
-- -- | Write @data.u64@ from @struct epoll_event@.
-- writeEventDataU64 ::
-- MutableByteArray RealWorld
-- -> Int -- ^ Index. Element are @struct epoll_event@.
-- -> Word64 -- ^ Data
-- -> IO ()
-- writeEventDataU64 !arr !ix !payload = do
-- -- See the comments on readEventDataU64
-- PM.writeByteArray arr (ix * 3 + 1) (word64ToWord32 (unsafeShiftR payload 32))
-- PM.writeByteArray arr (ix * 3 + 2) (word64ToWord32 payload)
Loading

0 comments on commit e4722bc

Please sign in to comment.