diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2010-12-24 18:41:05 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2010-12-24 18:41:05 +0000 |
commit | 410644c41a1b10798a0fe442c66f9bf582ecf067 (patch) | |
tree | 7562e7cd285a7a06e30ffabe52c2cf473a57ab9c /libobjc/ivars.c | |
parent | 5750872c618185a2f1161d24510ad2be8669338a (diff) |
In libobjc/: 2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/runtime.h (class_addIvar): Updated documentation. The
alignment is actually the log_2 of the alignment in bytes.
* ivars.c (class_addIvar): Corresponding change to the
implementation.
In gcc/testsuite/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/gnu-api-2-class.m: Updated test to pass log_2 of the
alignment to class_addIvar, instead of the alignment itself.
* obj-c++.dg/gnu-api-2-class.mm: Same change.
From-SVN: r168230
Diffstat (limited to 'libobjc/ivars.c')
-rw-r--r-- | libobjc/ivars.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libobjc/ivars.c b/libobjc/ivars.c index 7527df804d2..6111a03ea16 100644 --- a/libobjc/ivars.c +++ b/libobjc/ivars.c @@ -212,7 +212,7 @@ struct objc_ivar ** class_copyIvarList (Class class_, unsigned int *numberOfRetu BOOL class_addIvar (Class class_, const char * ivar_name, size_t size, - unsigned char alignment, const char *type) + unsigned char log_2_of_alignment, const char *type) { struct objc_ivar_list *ivars; @@ -270,6 +270,7 @@ class_addIvar (Class class_, const char * ivar_name, size_t size, size. */ { struct objc_ivar *ivar = &(ivars->ivar_list[ivars->ivar_count - 1]); + unsigned int alignment = 1 << log_2_of_alignment; int misalignment; ivar->ivar_name = objc_malloc (strlen (ivar_name) + 1); |