UPDATE: See "Update" below
What can cause unaligned pointers to end up on my stack? Or: what, on my stack, can look like unaligned pointers?
Context is that I'm trying to write a conservative GC. I want to scan the stack for things that look like pointers (and then mark them, but I'm not at that point yet). I copied & hacked together some code from other GCs I found, which essentially does the following:
- At program start: save the current
%rbp
away as the "stack bottom" (highest address) - When scanning stack: save now-current
%rbp
away as "stack top" (lowest address)