Changes between Version 18 and Version 19 of BlockObjects


Ignore:
Timestamp:
Aug 25, 2011 11:45:23 AM (3 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BlockObjects

    v18 v19  
    2020do 
    2121    -- convert a list of strings into a C array of stable pointers to those strings in the Haskell heap 
    22   myCharactersArray <- newArray $ mapM newStablePtr myCharacters 
     22  ptrs <- mapM newStablePtr myCharacters 
     23  myCharactersArray <- newArray ptrs 
    2324  
    2425   -- get the size in bytes of a stable pointer to a Haskell string 
    25   let elemSize = fromInteger $ sizeOf (undefined :: StablePtr String) 
     26  let elemSize = fromIntegral $ sizeOf (undefined :: StablePtr String) 
    2627 
    2728    -- invoke C land 'qsort_b' with a Haskell comparison function passed as a block object; mutates 'myCharactersArray'