Changeset 12103 for third-party
- Timestamp:
- 08/11/06 08:01:36 (2 years ago)
- Location:
- third-party/HsJudy
- Files:
-
- 1 added
- 12 modified
-
HsJudy.cabal (modified) (1 diff)
-
Judy/Hash.hs (modified) (2 diffs)
-
Judy/HashIO.hs (modified) (1 diff)
-
Judy/Private.hsc (modified) (2 diffs)
-
Judy/Stringable.hs (modified) (2 diffs)
-
Makefile (modified) (2 diffs)
-
Makefile.static (added)
-
TODO (modified) (2 diffs)
-
tests/CheckDup.hs (modified) (1 diff)
-
tests/TestBS.hs (modified) (1 diff)
-
tests/TestHash.hs (modified) (1 diff)
-
tests/TestIntMap.hs (modified) (1 diff)
-
tests/TestStrMap.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
third-party/HsJudy/HsJudy.cabal
r12102 r12103 6 6 author: Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com>, John Meacham 7 7 maintainer: Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com> 8 build-depends: base -any, pugs-fps -any8 build-depends: base 9 9 exposed-modules: Judy.BitSet Judy.Freeze Judy.Hash Judy.IntMap Judy.StrMap Judy.CollectionsM Judy.HashIO Judy.Refeable Judy.Stringable 10 10 other-modules: Judy.Private Judy.MiniGC 11 11 extensions: ForeignFunctionInterface 12 ghc-options: -fglasgow-exts -O2 -static12 ghc-options: -fglasgow-exts -O2 13 13 include-dirs: . ../judy/Judy-1.0.3/src 14 14 -- FIXME: make Cabal work nicely with _hsc files, now I think it works, but doesnt clean _hsc files 15 15 c-sources: Judy/Private_hsc.c 16 16 extra-libraries: Judy 17 extra-lib-dirs: . -
third-party/HsJudy/Judy/Hash.hs
r12024 r12103 70 70 mapM_ GC.freeRef es 71 71 v <- judyHSFreeArray j judyError 72 putStrLn $ "\n(FINALIZER CALLED FOR "++ (show j) ++ ": " ++ (show v) ++ ")\n"72 --putStrLn $ "\n(FINALIZER CALLED FOR "++ (show j) ++ ": " ++ (show v) ++ ")\n" 73 73 return () 74 74 … … 168 168 newIter = do 169 169 fp <- mallocForeignPtr 170 --addForeignPtrFinalizer judyHSIter_free_ptr fp170 addForeignPtrFinalizer judyHSIter_free_ptr fp 171 171 withForeignPtr fp $ flip poke nullPtr 172 172 return $ HashIter fp -
third-party/HsJudy/Judy/HashIO.hs
r10844 r12103 1 {-# OPTIONS -fallow-undecidable-instances -fallow-incoherent-instances #-}1 {-# OPTIONS -fallow-undecidable-instances -fallow-incoherent-instances -fallow-overlapping-instances #-} 2 2 3 3 module Judy.HashIO ( -
third-party/HsJudy/Judy/Private.hsc
r11639 r12103 3 3 4 4 import Foreign 5 6 #if __GLASGOW_HASKELL__ >= 605 5 7 import Data.Word 8 #else 9 --import Judy.Word 10 import GHC.Exts 11 #endif 12 6 13 import Foreign.C.Types 7 14 import Foreign.C.String … … 11 18 12 19 --type Value = (#type Word_t) 20 --type Value = CULong 21 22 #if __GLASGOW_HASKELL__ >= 605 13 23 type Value = WordPtr 14 --type Value = CULong 24 #else 25 type Value = (#type Word_t) 26 27 ptrToWordPtr :: Ptr () -> Value 28 ptrToWordPtr = unsafeCoerce## 29 30 wordPtrToPtr :: Value -> Ptr () 31 wordPtrToPtr = unsafeCoerce## 32 33 #endif 15 34 16 35 newtype JError = JError (Ptr ()) -
third-party/HsJudy/Judy/Stringable.hs
r12102 r12103 6 6 7 7 import Foreign.C.String 8 9 -- #if __GLASGOW_HASKELL__ >= 60510 8 import qualified Data.ByteString as B 11 -- #endif12 9 13 10 -- TODO: See if its possible to use Storable, ie. to let any Storable type be "stringable". … … 31 28 fromString = id 32 29 33 -- #if __GLASGOW_HASKELL__ >= 60534 30 instance Stringable B.ByteString where 35 toString = undefined36 fromString = undefined31 toString = undefined 32 fromString = undefined 37 33 38 useAsCS = B.useAsCString 39 useAsCSLen = B.useAsCStringLen 40 41 copyCS = B.copyCString 42 copyCSLen = B.copyCStringLen 43 -- #endif 34 useAsCS = B.useAsCString 35 useAsCSLen = B.useAsCStringLen 44 36 37 copyCS = B.copyCString 38 copyCSLen = B.copyCStringLen 45 39 46 40 --instance Stringable Int where -
third-party/HsJudy/Makefile
r12024 r12103 1 1 #GHC=ghc-6.4.2 2 2 GHC=ghc # -debug 3 3 4 CC=$(GHC) 4 5 TESTS=TestBS TestJL TestJSL TestJHS TestHash TestIntMap TestStrMap 6 #HSC2HS=/usr/bin/hsc2hs 7 HSC2HS=hsc2hs 8 5 9 6 10 CFLAGS= -O2 7 8 JUDY_SRC=../judy/Judy-1.0.39 10 11 11 LIB_JUDY=-lJudy 12 13 # static linking14 #LIB_JUDY=$(JUDY_SRC)/src/Judy1/*.o $(JUDY_SRC)/src/JudyL/*.o $(JUDY_SRC)/src/JudySL/*.o $(JUDY_SRC)/src/JudyHS/*.o $(JUDY_SRC)/src/JudyCommon/*.o15 16 12 17 13 CHEADERS= Judy/Private_hsc.h 18 14 HSFLAGS= $(HSF) -O2 -fffi -I/usr/local/include -fglasgow-exts -I. '-\#include Judy/Private_hsc.h' $(LIB_JUDY) 15 19 16 20 17 %.hi: %.o … … 26 23 27 24 %.hs: %.hsc 28 hsc2hs -C "-I/usr/local/include" -C "$(CFLAGS)" -o $@ $<25 $(HSC2HS) -C "-I/usr/local/include" -C "-I$(JUDY_SRC)/src" -C "$(CFLAGS)" -o $@ $< 29 26 30 27 all: $(TESTS) -
third-party/HsJudy/TODO
r11831 r12103 1 1 # TODO 2 - Use Judy for Hash and Array in Pugs. Maybe creating some special3 operators for Judy.Map2 to be used for Array (think shift and pop).4 2 - CollectionsM: complete the subset of MapM and uncomment/complete CollectionM. 5 3 - See if needGC hack can be improved. It seems its eating CPU time. … … 10 8 11 9 - Names names names 12 - Idea: Map2 -> IntMap13 - Should I call MapSL just Map too?10 - HashIO is too similar to Hash. Stringable is strange and not totally true, 11 maybe CStringable? 14 12 15 13 - Other missing malloc error checking -
third-party/HsJudy/tests/CheckDup.hs
r12102 r12103 1 {-# OPTIONS -fallow-overlapping-instances #-}2 3 1 import qualified Judy.Hash as H 4 2 import qualified Judy.StrMap as S -
third-party/HsJudy/tests/TestBS.hs
r11694 r12103 1 {-# OPTIONS -fallow-overlapping-instances #-} 2 1 3 import Test 2 4 -
third-party/HsJudy/tests/TestHash.hs
r12024 r12103 1 {-# OPTIONS -fallow-undecidable-instances -fallow-incoherent-instances #-}1 {-# OPTIONS -fallow-undecidable-instances -fallow-incoherent-instances -fallow-overlapping-instances #-} 2 2 3 3 import Test -
third-party/HsJudy/tests/TestIntMap.hs
r12024 r12103 1 {-# OPTIONS -fallow-undecidable-instances -fallow-incoherent-instances #-}1 {-# OPTIONS -fallow-undecidable-instances -fallow-incoherent-instances -fallow-overlapping-instances #-} 2 2 3 3 import Test -
third-party/HsJudy/tests/TestStrMap.hs
r12024 r12103 1 {-# OPTIONS -fallow-undecidable-instances -fallow-incoherent-instances #-}1 {-# OPTIONS -fallow-undecidable-instances -fallow-incoherent-instances -fallow-overlapping-instances #-} 2 2 3 3 import Test
