force alignment of headers

This commit is contained in:
Yuichi Nishiwaki
2013-10-13 16:02:08 +09:00
parent c250d3b07f
commit d92bd71293
2 changed files with 39 additions and 35 deletions
+7 -4
View File
@@ -1,13 +1,16 @@
#ifndef GC_H__
#define GC_H__
struct header {
struct header *ptr;
size_t size;
union header {
struct {
union header *ptr;
size_t size;
} s;
long alignment; /* force alignment for headers to be allocated at the size of long */
};
struct heap_page {
struct header *base, *freep;
union header *base, *freep;
size_t heap_size;
};