1 /* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 * Copyright (C) 1997-2000 NEC Research Institute.
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
9 objptr
getThreadCurrentObjptr (GC_state s
) {
10 return s
->currentThread
;
13 GC_thread
getThreadCurrent (GC_state s
) {
14 pointer p
= objptrToPointer(getThreadCurrentObjptr(s
), s
->heap
.start
);
15 return (GC_thread
)(p
+ offsetofThread (s
));
18 objptr
getStackCurrentObjptr (GC_state s
) {
19 GC_thread thread
= getThreadCurrent(s
);
23 GC_stack
getStackCurrent (GC_state s
) {
24 pointer p
= objptrToPointer(getStackCurrentObjptr(s
), s
->heap
.start
);