Support large alignment requests

The linux kernel has some structures that are page aligned,
i.e. 4096.  Instead of enlarging the bit fields to specify this,
use the fact that alignment is always power of two, and store only
the log2 minus 1 of it.  The 5 bits are enough to specify an alignment
of 1 << 30.
This commit is contained in:
Michael Matz
2016-10-09 02:41:34 +02:00
parent d815a0f658
commit 8859dc9e6d
3 changed files with 38 additions and 7 deletions

2
tcc.h
View File

@ -379,7 +379,7 @@ typedef struct SValue {
struct Attribute {
unsigned
func_call : 3, /* calling convention (0..5), see below */
aligned : 5, /* alignement (0..16) */
aligned : 5, /* alignment as log2+1 (0 == unspecified) */
packed : 1,
func_export : 1,
func_import : 1,