@@ -200,15 +200,15 @@ memchunks_size = PRE_IVAR->memchunks_size + 1; if (SIZE_MAX - PRE_IVAR->memchunks_size < 1 || memchunks_size > SIZE_MAX / sizeof(void*)) - @throw [OFOutOfRangeException newWithClass: [self class]]; + @throw [OFOutOfRangeException newWithClass: isa]; if ((memchunks = realloc(PRE_IVAR->memchunks, memchunks_size * sizeof(void*))) == NULL) - @throw [OFNoMemException newWithClass: [self class] + @throw [OFNoMemException newWithClass: isa andSize: memchunks_size]; PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; @@ -226,20 +226,20 @@ memchunks_size = PRE_IVAR->memchunks_size + 1; if (SIZE_MAX - PRE_IVAR->memchunks_size == 0 || memchunks_size > SIZE_MAX / sizeof(void*)) - @throw [OFOutOfRangeException newWithClass: [self class]]; + @throw [OFOutOfRangeException newWithClass: isa]; if ((ptr = malloc(size)) == NULL) - @throw [OFNoMemException newWithClass: [self class] + @throw [OFNoMemException newWithClass: isa andSize: size]; if ((memchunks = realloc(PRE_IVAR->memchunks, memchunks_size * sizeof(void*))) == NULL) { free(ptr); - @throw [OFNoMemException newWithClass: [self class] + @throw [OFNoMemException newWithClass: isa andSize: memchunks_size]; } PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; @@ -253,11 +253,11 @@ { if (nitems == 0 || size == 0) return NULL; if (nitems > SIZE_MAX / size) - @throw [OFOutOfRangeException newWithClass: [self class]]; + @throw [OFOutOfRangeException newWithClass: isa]; return [self getMemWithSize: nitems * size]; } - (void*)resizeMem: (void*)ptr @@ -276,20 +276,19 @@ iter = PRE_IVAR->memchunks + PRE_IVAR->memchunks_size; while (iter-- > PRE_IVAR->memchunks) { if (OF_UNLIKELY(*iter == ptr)) { if (OF_UNLIKELY((ptr = realloc(ptr, size)) == NULL)) - @throw [OFNoMemException - newWithClass: [self class] - andSize: size]; + @throw [OFNoMemException newWithClass: isa + andSize: size]; *iter = ptr; return ptr; } } - @throw [OFMemNotPartOfObjException newWithClass: [self class] + @throw [OFMemNotPartOfObjException newWithClass: isa andPointer: ptr]; return NULL; /* never reached, but makes gcc happy */ } - (void*)resizeMem: (void*)ptr @@ -306,11 +305,11 @@ [self freeMem: ptr]; return NULL; } if (nitems > SIZE_MAX / size) - @throw [OFOutOfRangeException newWithClass: [self class]]; + @throw [OFOutOfRangeException newWithClass: isa]; memsize = nitems * size; return [self resizeMem: ptr toSize: memsize]; } @@ -331,11 +330,11 @@ last = PRE_IVAR->memchunks[memchunks_size]; if (OF_UNLIKELY(PRE_IVAR->memchunks_size == 0 || memchunks_size > SIZE_MAX / sizeof(void*))) @throw [OFOutOfRangeException - newWithClass: [self class]]; + newWithClass: isa]; if (OF_UNLIKELY(memchunks_size == 0)) { free(ptr); free(PRE_IVAR->memchunks); @@ -347,11 +346,11 @@ if (OF_UNLIKELY((memchunks = realloc( PRE_IVAR->memchunks, memchunks_size * sizeof(void*))) == NULL)) @throw [OFNoMemException - newWithClass: [self class] + newWithClass: isa andSize: memchunks_size]; free(ptr); PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[i] = last; @@ -359,11 +358,11 @@ return self; } } - @throw [OFMemNotPartOfObjException newWithClass: [self class] + @throw [OFMemNotPartOfObjException newWithClass: isa andPointer: ptr]; return self; /* never reached, but makes gcc happy */ } - retain