Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add align field to storage_spec.

Also, adds initialisation of align field to all REPRs (and initialises a
couple of bits fields that weren't).
  • Loading branch information...
commit 2800c6ead38152f93aaf567795a0a5ab8285059d 1 parent d384d49
@arnsholt arnsholt authored
View
1  src/6model/reprs/CArray.c
@@ -191,6 +191,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
spec.bits = sizeof(void *) * 8;
+ spec.align = ALIGNOF(void *);
return spec;
}
View
1  src/6model/reprs/CPointer.c
@@ -64,6 +64,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
spec.bits = sizeof(void *) * 8;
+ spec.align = ALIGNOF(void *);
return spec;
}
View
1  src/6model/reprs/CStr.c
@@ -100,6 +100,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.boxed_primitive = STORAGE_SPEC_BP_STR;
spec.can_box = 0;
spec.bits = sizeof(void *) * 8;;
+ spec.align = ALIGNOF(void *);
return spec;
}
View
1  src/6model/reprs/CStruct.c
@@ -644,6 +644,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
spec.bits = sizeof(void *) * 8;
+ spec.align = ALIGNOF(void *);
return spec;
}
View
2  src/6model/reprs/HashAttrStore.c
@@ -103,6 +103,8 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.inlineable = STORAGE_SPEC_REFERENCE;
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
+ spec.bits = sizeof(void *);
+ spec.align = ALIGNOF(void *);
return spec;
}
View
2  src/6model/reprs/KnowHOWREPR.c
@@ -77,6 +77,8 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.inlineable = STORAGE_SPEC_REFERENCE;
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
+ spec.bits = sizeof(void *);
+ spec.align = ALIGNOF(void *);
return spec;
}
View
1  src/6model/reprs/NativeCall.c
@@ -105,6 +105,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
storage_spec spec;
spec.inlineable = STORAGE_SPEC_INLINED;
spec.bits = sizeof(NativeCallBody) * 8;
+ spec.align = ALIGNOF(void *);
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
return spec;
View
1  src/6model/reprs/P6bigint.c
@@ -139,6 +139,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
storage_spec spec;
spec.inlineable = STORAGE_SPEC_INLINED;
spec.bits = sizeof(mp_int) * 8;
+ spec.align = ALIGNOF(void *);
spec.boxed_primitive = STORAGE_SPEC_BP_INT;
spec.can_box = STORAGE_SPEC_CAN_BOX_INT;
return spec;
View
1  src/6model/reprs/P6num.c
@@ -108,6 +108,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
storage_spec spec;
spec.inlineable = STORAGE_SPEC_INLINED;
spec.bits = sizeof(FLOATVAL) * 8;
+ spec.align = ALIGNOF(void *);
spec.boxed_primitive = STORAGE_SPEC_BP_NUM;
spec.can_box = STORAGE_SPEC_CAN_BOX_NUM;
return spec;
View
2  src/6model/reprs/P6opaque.c
@@ -808,6 +808,8 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.inlineable = STORAGE_SPEC_REFERENCE;
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
+ spec.bits = sizeof(void *);
+ spec.align = ALIGNOF(void *);
if (repr_data->unbox_int_slot >= 0)
spec.can_box += STORAGE_SPEC_CAN_BOX_INT;
if (repr_data->unbox_num_slot >= 0)
View
1  src/6model/reprs/P6str.c
@@ -115,6 +115,7 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
storage_spec spec;
spec.inlineable = STORAGE_SPEC_INLINED;
spec.bits = sizeof(STRING *) * 8;
+ spec.align = ALIGNOF(void *);
spec.boxed_primitive = STORAGE_SPEC_BP_STR;
spec.can_box = STORAGE_SPEC_CAN_BOX_STR;
return spec;
View
2  src/6model/reprs/Uninstantiable.c
@@ -59,6 +59,8 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
spec.inlineable = STORAGE_SPEC_REFERENCE;
spec.boxed_primitive = STORAGE_SPEC_BP_NONE;
spec.can_box = 0;
+ spec.bits = sizeof(void *);
+ spec.align = ALIGNOF(void *);
return spec;
}
View
4 src/6model/storage_spec.h
@@ -12,8 +12,10 @@ typedef struct {
INTVAL inlineable;
/* For things that want to be inlined, the number of bits of
- * storage they need. Ignored otherwise. */
+ * storage they need and what kind of byte-boundary they want to
+ * be aligned to. Ignored otherwise. */
INTVAL bits;
+ INTVAL align;
/* For things that are inlined, if they are just storage of a
* primitive type and can unbox, this says what primitive type
Please sign in to comment.
Something went wrong with that request. Please try again.