Differences From Artifact [352bb910bc]:
- File src/OFObject.m — part of check-in [8dbc052d49] at 2009-04-22 22:43:52 on branch trunk — gcc seems to accept a @throw instead of a return as well. (user: js, size: 8237) [annotate] [blame] [check-ins using]
To Artifact [a774c5de86]:
- File
src/OFObject.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: 8225) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
210 211 212 213 214 215 216 | PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; return self; } | | | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; return self; } - (void*)allocWithSize: (size_t)size { void *ptr, **memchunks; size_t memchunks_size; if (size == 0) return NULL; |
︙ | ︙ | |||
242 243 244 245 246 247 248 | PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; return ptr; } | | | | | | 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; return ptr; } - (void*)allocNItems: (size_t)nitems withSize: (size_t)size { if (nitems == 0 || size == 0) return NULL; if (nitems > SIZE_MAX / size) @throw [OFOutOfRangeException newWithClass: isa]; return [self allocWithSize: nitems * size]; } - (void*)resizeMem: (void*)ptr toSize: (size_t)size { void **iter; if (ptr == NULL) return [self allocWithSize: size]; if (size == 0) { [self freeMem: ptr]; return NULL; } iter = PRE_IVAR->memchunks + PRE_IVAR->memchunks_size; |
︙ | ︙ | |||
286 287 288 289 290 291 292 | @throw [OFMemNotPartOfObjException newWithClass: isa andPointer: ptr]; } - (void*)resizeMem: (void*)ptr toNItems: (size_t)nitems | | | | | 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | @throw [OFMemNotPartOfObjException newWithClass: isa andPointer: ptr]; } - (void*)resizeMem: (void*)ptr toNItems: (size_t)nitems withSize: (size_t)size { size_t memsize; if (ptr == NULL) return [self allocNItems: nitems withSize: size]; if (nitems == 0 || size == 0) { [self freeMem: ptr]; return NULL; } if (nitems > SIZE_MAX / size) |
︙ | ︙ |