unliftio 0.2.20 → 0.2.20.1
raw patch · 4 files changed
+43/−10 lines, 4 files
Files
- ChangeLog.md +4/−0
- cbits/time-osx.c +2/−9
- src/UnliftIO/Temporary.hs +36/−0
- unliftio.cabal +1/−1
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for unliftio +## 0.2.20.1++* Fix time-osx.c for aarch64 mac [#91](https://github.com/fpco/unliftio/pull/91)+ ## 0.2.20 * Add lifted `System.IO.openFile` (https://github.com/fpco/unliftio/pull/88)
cbits/time-osx.c view
@@ -1,20 +1,13 @@ /* From https://github.com/bos/criterion */ #include <mach/mach.h>-#include <mach/mach_time.h>--static mach_timebase_info_data_t timebase_info;-static double timebase_recip;+#include <time.h> void unliftio_inittime(void) {- if (timebase_recip == 0) {- mach_timebase_info(&timebase_info);- timebase_recip = (timebase_info.denom / timebase_info.numer) / 1e9;- } } double unliftio_gettime(void) {- return mach_absolute_time() * timebase_recip;+ return clock_gettime_nsec_np(CLOCK_UPTIME_RAW); }
src/UnliftIO/Temporary.hs view
@@ -4,6 +4,42 @@ -- Strongly inspired by\/stolen from the <https://github.com/feuerbach/temporary> package. -- -- @since 0.1.0.0+--+-- === __Copyright notice:__+--+-- The following copyright notice is taken from <https://github.com/feuerbach/temporary>+-- and is reproduced here as part of license terms of that package, of which this module is+-- a derivate work.+--+-- @+-- Copyright+-- (c) 2003-2006, Isaac Jones+-- (c) 2005-2009, Duncan Coutts+-- (c) 2008, Maximilian Bolingbroke+-- ... and other contributors+--+-- All rights reserved.+--+-- Redistribution and use in source and binary forms, with or without modification, are permitted+-- provided that the following conditions are met:+--+-- * Redistributions of source code must retain the above copyright notice, this list of+-- conditions and the following disclaimer.+-- * Redistributions in binary form must reproduce the above copyright notice, this list of+-- conditions and the following disclaimer in the documentation and/or other materials+-- provided with the distribution.+-- * Neither the name of Maximilian Bolingbroke nor the names of other contributors may be used to+-- endorse or promote products derived from this software without specific prior written permission.+--+-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR+-- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND+-- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR+-- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL+-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER+-- IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT+-- OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+-- @ module UnliftIO.Temporary ( withSystemTempFile , withSystemTempDirectory
unliftio.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: unliftio-version: 0.2.20+version: 0.2.20.1 synopsis: The MonadUnliftIO typeclass for unlifting monads to IO (batteries included) description: Please see the documentation and README at <https://www.stackage.org/package/unliftio> category: Control