Differences From Artifact [a34c760d2b]:
- File
src/OFDictionary.m
— part of check-in
[e959fed010]
at
2009-04-26 12:44:20
on branch trunk
— A few renames in OFObject.
getMemWithSize: -> allocWithSize:
getMemForNItems:ofSize: -> allocNItems:withSize:
resizeMem:toNItems:ofSize: -> resizeMem:toNItems:withSize: (user: js, size: 3143) [annotate] [blame] [check-ins using]
To Artifact [84c38f0c0c]:
- File
src/OFDictionary.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: 3146) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
37 38 39 40 41 42 43 | size = 4096; @try { data = [self allocNItems: size withSize: sizeof(OFList*)]; } @catch (OFException *e) { | | | | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | size = 4096; @try { data = [self allocNItems: size withSize: sizeof(OFList*)]; } @catch (OFException *e) { [super free]; @throw e; } memset(data, 0, size); return self; } - initWithHashSize: (int)hashsize { self = [super init]; if (hashsize < 8 || hashsize > 31) { Class c = isa; [super free]; @throw [OFInvalidArgumentException newWithClass: c andSelector: _cmd]; } size = (size_t)1 << hashsize; @try { data = [self allocNItems: size withSize: sizeof(OFList*)]; } @catch (OFException *e) { [super free]; @throw e; } memset(data, 0, size); return self; } |
︙ | ︙ |