1 /* Copyright (C) 2016 Matthew Fluet.
2 * Copyright (C) 1999-2006 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 size_t alignWithExtra (GC_state s
, size_t bytes
, size_t extra
) {
11 return align (bytes
+ extra
, s
->alignment
) - extra
;
16 bool isFrontierAligned (GC_state s
, pointer p
) {
17 return isAligned ((size_t)p
+ GC_NORMAL_METADATA_SIZE
, s
->alignment
);
21 pointer
alignFrontier (GC_state s
, pointer p
) {
24 res
= alignWithExtra (s
, (size_t)p
, GC_NORMAL_METADATA_SIZE
);
25 assert (isFrontierAligned (s
, (pointer
)res
));