- 28 Jan, 2003 4 commits
-
-
simonmar authored
Update the FFI docs to use hs_init()/hs_exit() rather than startupHaskell()/shutdownHaskell().
-
simonmar authored
Flesh out support for hs_init() and hs_exit() according to the latest FFI spec. For GHC, I also added: hs_add_root( void (*fn)(void) ); which is used to specify the root module. This *must* be called prior to invoking any Haskell functions. The previous way of doing things still works: startupHaskell( argc, argv, root ); but the right way to do this is now hs_init( &argc, &argv ); hs_add_root( root ); It is possible to invoke hs_add_root() multiple times with different roots. - setProgArgv() has been removed; it was unused and looks like it was there to support STG Hugs.
-
simonmar authored
Initialise prog_argc, prog_argv and rts_argc to sensible zero values just in case hs_init() is called without passing any arguments in.
-
simonmar authored
- Add headers - Make initThreadLabels multi-init-safe
-
- 27 Jan, 2003 3 commits
- 26 Jan, 2003 1 commit
-
-
panne authored
Synched OpenGL detection macro with HOpenGL-1.04. TODO: Modularization of the macro and caching.
-
- 25 Jan, 2003 1 commit
-
-
wolfgang authored
This commit fixes many bugs and limitations in the threaded RTS. There are still some issues remaining, though. The following bugs should have been fixed: - [+] "safe" calls could cause crashes - [+] yieldToReturningWorker/grabReturnCapability - It used to deadlock. - [+] couldn't wake blocked workers - Calls into the RTS could go unanswered for a long time, and that includes ordinary callbacks in some circumstances. - [+] couldn't block on an MVar and expect to be woken up by a signal handler - Depending on the exact situation, the RTS shut down or blocked forever and ignored the signal. - [+] The locking scheme in RtsAPI.c didn't work - [+] run_thread label in wrong place (schedule()) - [+] Deadlock in GHC.Handle - if a signal arrived at the wrong time, an mvar was never filled again - [+] Signals delivered to the "wrong" thread were ignored or handled too late. Issues: *) If GC can move TSO objects (I don't know - can it?), then ghci will occasionally crash when calling foreign functions, because the parameters are stored on the TSO stack. *) There is still a race condition lurking in the code (both threaded and non-threaded RTS are affected): If a signal arrives after the check for pending signals in schedule(), but before the call to select() in awaitEvent(), select() will be called anyway. The signal handler will be executed much later than expected. *) For Win32, GHC doesn't yet support non-blocking IO, so while a thread is waiting for IO, no call-ins can happen. If the RTS is blocked in awaitEvent, it uses a polling loop on Win32, so call-ins should work (although the polling loop looks ugly). *) Deadlock detection is disabled for the threaded rts, because I don't know how to do it properly in the presence of foreign call-ins from foreign threads. This causes the tests conc031, conc033 and conc034 to fail. *) "safe" is currently treated as "threadsafe". Implementing "safe" in a way that blocks other Haskell threads is more difficult than was thought at first. I think it could be done with a few additional lines of code, but personally, I'm strongly in favour of abolishing the distinction. *) Running finalizers at program termination is inefficient - there are two OS threads passing messages back and forth for every finalizer that is run. Also (just as in the non-threaded case) the finalizers are run in parallel to any remaining haskell threads and to any foreign call-ins that might still happen.
-
- 24 Jan, 2003 4 commits
-
-
simonmar authored
remove setting of $(way_) and $(_way); these are now set in boilerplate.mk
-
simonmar authored
- Generalise seq to allow an unlifted type in its second argument. This works because seq is *always* inlined and replaced by a case. - Remove getTag, a wired-in Id with an unfolding, with a definition in GHC.Base: getTag x = x `seq` dataToTag# x this is why we required the above generalisation to seq (dataToTag# returns an Int#). See the comments in GHC.Base for more details. - As a side-effect, this fixes a bug in the interpreter, where the compiler optimised away the evaluation of the argument to dataToTag#, but the interpreter ended up passing it an unevaluated thunk (nullary constructors aren't always evaluated in GHCi, but the simplifier assumes they are). Now, in the interpreter, getTag won't be inlined so the compiler can't optimise away the evaluation, and we're saved. The real bug here is either (a) dataToTag# requires an evaluated argument or (b) the interpreter doesn't supply it with one, take your pick.
-
simonmar authored
- Reverse the code for workers and wrappers for nullary constructors. For some reason it was the wrong way around, but the effects were harmless since they both evaluate to the same thing. - When passing a nullary constructor as an argument, we should pass the name of the worker rather than the wrapper. Again, this is mostly harmless, but it enables some small simplification in pushAtom. - Rearrange/cleanup pushAtom.
-
simonpj authored
Perform 'tidying' on the implicit bindings before emitting External Core. We were getting silly bindings like \ tpl -> case tpl of tpl -> (tpl,tpl) -> tpl Maybe we should add these implicit bindings in CoreTidy, rather than in both MkExternalCore and CorePrep?
-
- 23 Jan, 2003 12 commits
-
-
simonmar authored
Fix compilation with DEBUG
-
simonmar authored
We have to desugar polymorphic FFI declarations properly, too. (companion commit to rev. 1.84 of TcType.lhs).
-
simonmar authored
Allow FFI declarations to have polymorphic types. eg: foreign import ccall unsafe "stdlib.h &free" pFree :: FunPtr (Ptr a -> IO ()) (the change actually removed a line, the extra lines are because I reformatted an import declaration).
-
simonpj authored
Refine documentation of newtype-deriving stuff
-
simonpj authored
Document warning suppression with leading underscore on variable names
-
simonpj authored
Suppress "No explicit method or default decl given for m" if the method name starts with an underscore This in response to a suggestion by George Russel
-
simonpj authored
Improve error message again
-
simonpj authored
Fix two small bugs in deriving mechanism, both concerning error reporting
-
simonpj authored
Improve error message
-
simonmar authored
Document +RTS -xt
-
simonmar authored
- Add a new flag, -xt, which enables inclusion of TSOs in a heap profile. - Include large objects in heap profiles (except TSOs unless the -xt flag is given). - In order to make this work, I had to set the bd->free field of the block descriptor for a large object to the correct value. Previously, it pointed to the start of the block (i.e. the same as bd->start). I hope this doesn't have any other consequences; it looks more correct this way in any case.
-
simonmar authored
A nullary constructor in an argument position should refer to the constructor worker, not the wrapper. In most cases they're the same, but when using -funbox-strict-fields (or maybe a context on a data type?) they can be different, leading to a crash. MERGE TO STABLE
-
- 20 Jan, 2003 1 commit
-
-
simonpj authored
Increase the size of a string literal; cures a simplifier loop when an application (f "x") appeared to have size 1, and so was inlined repeatedly. The problem was that "x" appeared to have size 0.
-
- 19 Jan, 2003 1 commit
-
-
wolfgang authored
Fix two really bad typos in the Mac OS X specific code MERGE TO STABLE
-
- 17 Jan, 2003 3 commits
-
-
stolz authored
- Add sendfile-API for pumping out data via sendfile(2) Currently supported are Linux (tested) & FreeBSD (not tested yet), others will throw a runtime error until I get around to implement a fallback.
-
sof authored
mingw: use cp's -u flag when copying over hi-boot files (or not, as the case might be now.)
-
sof authored
for mingw builds, redirect to NUL
-
- 14 Jan, 2003 3 commits
- 13 Jan, 2003 7 commits
-
-
simonpj authored
------------------------------------ (a) Improve reporting of staging errors (b) Tidy up the construction of dict funs and default methods ------------------------------------
-
simonpj authored
Bale out earlier if main is not in scope (fixes several test failures)
-
simonmar authored
The hook NoRunnableThreads() is not used; kill it.
-
simonpj authored
wibble
-
simonpj authored
Comment
-
simonpj authored
-------------------------------- Don't export the inlining for a foreign import that has a #include directive -------------------------------- Reason for this change: if the inlining is imported into another module, the latter may not have the right #include directives. Also add notes to the documentation to explain the issues.
-
simonpj authored
------------------------------------ Type signature for derived con2tag ------------------------------------ MERGE TO STABLE The derived con2tag didn't have a type signature, so we got con2tagFoo :: a -> Int# con2tagFoo = \x -> getTag x The getTag generates a case expression, so we get a polymorphic case. The polymorphic case simply does not work in *interpreted* GHC 5.02.3 and as a result neither does con2tag. Alas. This commit fixes the problem, by giving a type signature for con2TagFoo. But note that getTag in interpreted GHC 5.02 will continue to fail if used in a polymorphic context. This problem does not arise in the HEAD (eval/apply) so I'm going to leave it as a wont-fix bug.
-