1 /* Copyright (C) 2010 Matthew Fluet.
2 * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 * Copyright (C) 1997-2000 NEC Research Institute.
6 * MLton is released under a BSD-style license.
7 * See the file MLton-LICENSE for details.
10 /* ---------------------------------------------------------------- */
12 /* ---------------------------------------------------------------- */
14 void translateObjptr (GC_state s
,
19 from
= s
->translateState
.from
;
20 to
= s
->translateState
.to
;
21 p
= objptrToPointer (*opp
, from
);
23 *opp
= pointerToObjptr (p
, to
);
26 /* translateHeap (s, from, to, size)
28 void translateHeap (GC_state s
, pointer from
, pointer to
, size_t size
) {
34 if (DEBUG
or s
->controls
.messages
)
36 "[GC: Translating old-gen of size %s bytes of heap at "FMTPTR
" from "FMTPTR
".]\n",
37 uintmaxToCommaString(size
),
40 s
->translateState
.from
= from
;
41 s
->translateState
.to
= to
;
42 /* Translate globals and heap. */
43 foreachGlobalObjptr (s
, translateObjptr
);
45 foreachObjptrInRange (s
, alignFrontier (s
, to
), &limit
, translateObjptr
, FALSE
);