1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-08 22:50:27 +02:00
guile/gc-align.h
Andy Wingo d2bde8319f Add conservative stack capture
This isn't really wired up yet anywhere, but add a precursor to
conservative stack scanning.
2022-10-03 16:09:21 +02:00

17 lines
363 B
C

#ifndef GC_ALIGN_H
#define GC_ALIGN_H
#ifndef GC_IMPL
#error internal header file, not part of API
#endif
#include <stdint.h>
static inline uintptr_t align_down(uintptr_t addr, size_t align) {
return addr & ~(align - 1);
}
static inline uintptr_t align_up(uintptr_t addr, size_t align) {
return align_down(addr + align - 1, align);
}
#endif // GC_ALIGN_H