Remove the use-c-malloc build flag (#1793)

* Remove the use-c-malloc build flag
This commit is contained in:
Ranjeet Ranjan 2022-08-22 14:15:52 +05:30 committed by GitHub
parent 9aa5b21e60
commit 0be81f99fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 60 deletions

View File

@ -1,49 +0,0 @@
#include "inline.hs"
-- |
-- Module : Streamly.Internal.Foreign.Malloc
-- Copyright : (c) 2019 Composewell Technologies
--
-- License : BSD-3-Clause
-- Maintainer : streamly@composewell.com
-- Stability : experimental
-- Portability : GHC
--
module Streamly.Internal.Foreign.Malloc
(
mallocForeignPtrAlignedBytes
, mallocForeignPtrAlignedUnmanagedBytes
)
where
-- We use GHC malloc by default
import Foreign.ForeignPtr (ForeignPtr, newForeignPtr_)
import Foreign.Marshal.Alloc (mallocBytes)
#ifdef USE_C_MALLOC
import Foreign.ForeignPtr (newForeignPtr)
import Foreign.Marshal.Alloc (finalizerFree)
#endif
import qualified GHC.ForeignPtr as GHC
{-# INLINE mallocForeignPtrAlignedBytes #-}
mallocForeignPtrAlignedBytes :: Int -> Int -> IO (GHC.ForeignPtr a)
#ifdef USE_C_MALLOC
mallocForeignPtrAlignedBytes size _alignment = do
p <- mallocBytes size
newForeignPtr finalizerFree p
#else
mallocForeignPtrAlignedBytes =
GHC.mallocPlainForeignPtrAlignedBytes
#endif
-- memalign alignment size
-- foreign import ccall unsafe "stdlib.h posix_memalign" _memalign :: CSize -> CSize -> IO (Ptr a)
mallocForeignPtrAlignedUnmanagedBytes :: Int -> Int -> IO (ForeignPtr a)
mallocForeignPtrAlignedUnmanagedBytes size _alignment = do
-- XXX use posix_memalign/aligned_alloc for aligned allocation
p <- mallocBytes size
newForeignPtr_ p

View File

@ -237,7 +237,6 @@ library
, Streamly.Internal.Control.Monad
, Streamly.Internal.Control.ForkIO
, Streamly.Internal.Data.Cont
, Streamly.Internal.Foreign.Malloc
, Streamly.Internal.System.IO
, Streamly.Internal.Data.IsMap

View File

@ -137,7 +137,6 @@ extra-source-files:
core/src/Streamly/Internal/Control/Monad.hs
core/src/Streamly/Internal/Control/ForkIO.hs
core/src/Streamly/Internal/Data/Cont.hs
core/src/Streamly/Internal/Foreign/Malloc.hs
core/src/Streamly/Internal/System/IO.hs
core/src/Streamly/Internal/Data/IsMap.hs
core/src/Streamly/Internal/Data/Tuple/Strict.hs
@ -287,11 +286,6 @@ flag has-llvm
manual: True
default: False
flag use-c-malloc
description: Use C malloc instead of GHC malloc
manual: True
default: False
flag opt
description: off=GHC default, on=-O2
manual: True
@ -324,9 +318,6 @@ common compile-options
if flag(inspection)
cpp-options: -DINSPECTION
if flag(use-c-malloc)
cpp-options: -DUSE_C_MALLOC
ghc-options: -Weverything
-Wno-implicit-prelude
-Wno-missing-deriving-strategies
@ -534,7 +525,6 @@ library
, Streamly.Internal.Control.Monad
, Streamly.Internal.Control.ForkIO
, Streamly.Internal.Data.Cont
, Streamly.Internal.Foreign.Malloc
, Streamly.Internal.System.IO
-- streamly-strict-data