summaryrefslogtreecommitdiff
path: root/rts/RtsAPI.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in error message (#3848)Simon Marlow2010-01-301-1/+1
|
* Make allocatePinned use local storage, and other refactoringsSimon Marlow2009-12-011-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a batch of refactoring to remove some of the GC's global state, as we move towards CPU-local GC. - allocateLocal() now allocates large objects into the local nursery, rather than taking a global lock and allocating then in gen 0 step 0. - allocatePinned() was still allocating from global storage and taking a lock each time, now it uses local storage. (mallocForeignPtrBytes should be faster with -threaded). - We had a gen 0 step 0, distinct from the nurseries, which are stored in a separate nurseries[] array. This is slightly strange. I removed the g0s0 global that pointed to gen 0 step 0, and removed all uses of it. I think now we don't use gen 0 step 0 at all, except possibly when there is only one generation. Possibly more tidying up is needed here. - I removed the global allocate() function, and renamed allocateLocal() to allocate(). - the alloc_blocks global is gone. MAYBE_GC() and doYouWantToGC() now check the local nursery only.
* Detect C finalizer callbacks in rts_lock() instead of schedule()Simon Marlow2009-08-191-0/+9
| | | | | Otherwise, finalizer callbacks cause a deadlock in the threaded RTS (including GHCi)
* RTS tidyup sweep, first phaseSimon Marlow2009-08-021-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first phase of this tidyup is focussed on the header files, and in particular making sure we are exposinng publicly exactly what we need to, and no more. - Rts.h now includes everything that the RTS exposes publicly, rather than a random subset of it. - Most of the public header files have moved into subdirectories, and many of them have been renamed. But clients should not need to include any of the other headers directly, just #include the main public headers: Rts.h, HsFFI.h, RtsAPI.h. - All the headers needed for via-C compilation have moved into the stg subdirectory, which is self-contained. Most of the headers for the rest of the RTS APIs have moved into the rts subdirectory. - I left MachDeps.h where it is, because it is so widely used in Haskell code. - I left a deprecated stub for RtsFlags.h in place. The flag structures are now exposed by Rts.h. - Various internal APIs are no longer exposed by public header files. - Various bits of dead code and declarations have been removed - More gcc warnings are turned on, and the RTS code is more warning-clean. - More source files #include "PosixSource.h", and hence only use standard POSIX (1003.1c-1995) interfaces. There is a lot more tidying up still to do, this is just the first pass. I also intend to standardise the names for external RTS APIs (e.g use the rts_ prefix consistently), and declare the internal APIs as hidden for shared libraries.
* replace sparc-specific Int64 code with calls to platform-independent macrosSimon Marlow2009-07-271-116/+4
|
* Remove old GUM/GranSim codeSimon Marlow2009-06-021-12/+0
|
* Fix #3236: emit a helpful error message when the RTS has not been initialisedSimon Marlow2009-05-181-6/+0
|
* SPARC: Fix ffi019 split load/store of HsInt64 into two parts to respect ↵Ben.Lippmeier@anu.edu.au2009-03-311-0/+51
| | | | alignment constraints
* SPARC NCG: When getting a 64 bit word, promote halves to 64 bit before shiftingBen.Lippmeier@anu.edu.au2009-03-301-1/+1
|
* SPARC NCG: Also do misaligned reads (this time for sure!)Ben.Lippmeier@anu.edu.au2009-01-221-8/+8
|
* SPARC NCG: Also do misaligned readsBen.Lippmeier@anu.edu.au2009-01-211-0/+25
|
* SPARC NCG: Add a SPARC version of rts_mkInt64 that handles misaligned ↵Ben.Lippmeier@anu.edu.au2009-01-211-0/+28
| | | | closure payloads.
* Fix some more shutdown racesSimon Marlow2008-11-191-8/+10
| | | | | | | There were races between workerTaskStop() and freeTaskManager(): we need to be sure that all Tasks have exited properly before we start tearing things down. This isn't completely straighforward, see comments for details.
* fix #2594: we were erroneously applying masks, as the reporter suggestedSimon Marlow2008-09-301-3/+3
| | | | | | My guess is that this is left over from when we represented Int8 and friends as zero-extended rather than sign-extended. It's amazing it hasn't been noticed earlier.
* rts_evalStableIO: start the new thread in blocked modeSimon Marlow2008-07-091-0/+3
|
* Pointer TaggingSimon Marlow2007-07-271-17/+21
| | | | | | | | | | | | | | | | | | | | | | This patch implements pointer tagging as per our ICFP'07 paper "Faster laziness using dynamic pointer tagging". It improves performance by 10-15% for most workloads, including GHC itself. The original patches were by Alexey Rodriguez Yakushev <mrchebas@gmail.com>, with additions and improvements by me. I've re-recorded the development as a single patch. The basic idea is this: we use the low 2 bits of a pointer to a heap object (3 bits on a 64-bit architecture) to encode some information about the object pointed to. For a constructor, we encode the "tag" of the constructor (e.g. True vs. False), for a function closure its arity. This enables some decisions to be made without dereferencing the pointer, which speeds up some common operations. In particular it enables us to avoid costly indirect jumps in many cases. More information in the commentary: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/HaskellExecution/PointerTagging
* remove unused includes, now that Storage.h & Stable.h are included by Rts.hSimon Marlow2006-11-151-1/+0
|
* Split GC.c, and move storage manager into sm/ directorySimon Marlow2006-10-241-0/+1
| | | | | | | | | | | | | | | | | In preparation for parallel GC, split up the monolithic GC.c file into smaller parts. Also in this patch (and difficult to separate, unfortunatley): - Don't include Stable.h in Rts.h, instead just include it where necessary. - consistently use STATIC_INLINE in source files, and INLINE_HEADER in header files. STATIC_INLINE is now turned off when DEBUG is on, to make debugging easier. - The GC no longer takes the get_roots function as an argument. We weren't making use of this generalisation.
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+597
Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.