| 1 | /* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh |
| 2 | * Jagannathan, and Stephen Weeks. |
| 3 | * Copyright (C) 1997-2000 NEC Research Institute. |
| 4 | * |
| 5 | * MLton is released under a BSD-style license. |
| 6 | * See the file MLton-LICENSE for details. |
| 7 | */ |
| 8 | |
| 9 | size_t GC_size (GC_state s, pointer root) { |
| 10 | size_t res; |
| 11 | |
| 12 | enter (s); /* update stack in heap, in case it is reached */ |
| 13 | if (DEBUG_SIZE) |
| 14 | fprintf (stderr, "GC_size marking\n"); |
| 15 | res = dfsMarkByMode (s, root, MARK_MODE, FALSE, FALSE); |
| 16 | if (DEBUG_SIZE) |
| 17 | fprintf (stderr, "GC_size unmarking\n"); |
| 18 | dfsMarkByMode (s, root, UNMARK_MODE, FALSE, FALSE); |
| 19 | leave(s); |
| 20 | |
| 21 | return res; |
| 22 | } |