Skip to content
Snippets Groups Projects
Commit cd1a93d8 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 2000-08-21 14:16:57 by simonmar]

- add touch# and foreignObjToAddr# primops.

- add these functions to ForeignObj:

	withForeignObj  :: ForeignObj -> (Addr -> IO a) -> IO a
	touchForeignObj :: ForeignObj -> IO ()

- foreignObjToAddr, which was previously implemented using a _casm_, now
  uses the foreignObjToAddr# primop.

- replace implementations of readXXXOffForeignObj and writeXXXOffForeignObj
  using the withForeignObj and the Addr operations.  ForeignObj.lhs now has
  no _casms_ in it!  (it still can't be compiled with the NCG though, because
  it has a f.i.d.)
parent 601bd950
No related merge requests found
/* -----------------------------------------------------------------------------
* $Id: PrimOps.h,v 1.60 2000/08/07 23:37:23 qrczak Exp $
* $Id: PrimOps.h,v 1.61 2000/08/21 14:16:57 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -859,6 +859,9 @@ EXTFUN_RTS(finalizzeWeakzh_fast);
#define ForeignObj_CLOSURE_DATA(c) (((StgForeignObj *)c)->data)
#define foreignObjToAddrzh(r,fo) r=ForeignObj_CLOSURE_DATA(fo)
#define touchzh(o) /* nothing */
EXTFUN_RTS(mkForeignObjzh_fast);
#define writeForeignObjzh(res,datum) \
......@@ -880,6 +883,7 @@ EXTFUN_RTS(mkForeignObjzh_fast);
#endif
/* -----------------------------------------------------------------------------
Constructor tags
-------------------------------------------------------------------------- */
......
......@@ -325,6 +325,8 @@ __export PrelGHC
ForeignObjzh
mkForeignObjzh
writeForeignObjzh
foreignObjToAddrzh
touchzh
StablePtrzh
makeStablePtrzh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment