[project @ 2001-01-11 17:25:56 by simonmar]
[ghc-hetmet.git] / ghc / rts / RtsAPIDeprec.c
1 /* ----------------------------------------------------------------------------
2  * $Id: RtsAPIDeprec.c,v 1.1 2001/01/11 17:25:56 simonmar Exp $
3  *
4  * (c) The GHC Team, 1998-2001
5  *
6  * RTS API functions that are deprecated
7  *
8  * --------------------------------------------------------------------------*/
9
10 #include "Rts.h"
11 #include "RtsUtils.h"
12 #include "Storage.h"
13 #include "Prelude.h"
14
15 HaskellObj
16 rts_mkAddr (HsAddr a)
17 {
18   StgClosure *p = (StgClosure *)allocate(sizeofW(StgHeader)+1);
19   p->header.info = Azh_con_info;
20   p->payload[0]  = (StgClosure *)a;
21   return p;
22 }
23
24 HsAddr
25 rts_getAddr (HaskellObj p)
26 {
27   if ( p->header.info == Azh_con_info || 
28        p->header.info == Azh_static_info ) {
29   
30     return (void *)(p->payload[0]);
31   } else {
32     barf("getAddr: not an Addr");
33   }
34 }