Differences From Artifact [5aad2dc149]:
- File
src/OFArray.m
— part of check-in
[e9d48d0beb]
at
2009-05-01 18:15:32
on branch trunk
— Call [super free] on error in init methods.
Reason is that - free might free stuff which is allocated during the
initialization, which might not be allocated when an error occurred. (user: js, size: 4872) [annotate] [blame] [check-ins using]
To Artifact [09953b1423]:
- File src/OFArray.m — part of check-in [4eb87f934f] at 2009-05-03 15:49:04 on branch trunk — Remove multiply overflow check in OFArray - it's done by resizeMem. (user: js, size: 4797) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
79 80 81 82 83 84 85 |
- (void*)last
{
return data + (items - 1) * itemsize;
}
- add: (void*)item
{
| | | | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
- (void*)last
{
return data + (items - 1) * itemsize;
}
- add: (void*)item
{
if (SIZE_MAX - items < 1)
@throw [OFOutOfRangeException newWithClass: isa];
data = [self resizeMem: data
toNItems: items + 1
withSize: itemsize];
memcpy(data + items++ * itemsize, item, itemsize);
return self;
}
- addNItems: (size_t)nitems
fromCArray: (void*)carray
{
if (nitems > SIZE_MAX - items)
@throw [OFOutOfRangeException newWithClass: isa];
data = [self resizeMem: data
toNItems: items + nitems
withSize: itemsize];
memcpy(data + items * itemsize, carray, nitems * itemsize);
|
| ︙ | ︙ |