mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-28 14:00:31 +02:00
Add conservative stack capture
This isn't really wired up yet anywhere, but add a precursor to conservative stack scanning.
This commit is contained in:
parent
a5b1a66d21
commit
d2bde8319f
10 changed files with 200 additions and 58 deletions
17
gc-align.h
Normal file
17
gc-align.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
#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
|
Loading…
Add table
Add a link
Reference in a new issue