@@ -41,11 +41,11 @@ - setToCString: (const char*)str { size_t len; if (string != NULL) - [self freeMem: string]; + [self freeMemory: string]; len = strlen(str); switch (of_string_check_utf8(str, len)) { case 1: @@ -58,11 +58,11 @@ @throw [OFInvalidEncodingException newWithClass: isa]; } length = len; - string = [self allocWithSize: length + 1]; + string = [self allocMemoryWithSize: length + 1]; memcpy(string, str, length + 1); return self; } @@ -83,12 +83,12 @@ break; case -1: @throw [OFInvalidEncodingException newWithClass: isa]; } - string = [self resizeMem: string - toSize: length + strlength + 1]; + string = [self resizeMemory: string + toSize: length + strlength + 1]; memcpy(string + length, str, strlength + 1); length += strlength; return self; } @@ -118,11 +118,11 @@ /* * This is only the most likely error to happen. * Unfortunately, as errno isn't always thread-safe, there's * no good way for us to find out what really happened. */ - @throw [OFNoMemException newWithClass: isa]; + @throw [OFOutOfMemoryException newWithClass: isa]; @try { [self appendCString: t]; } @finally { free(t); @@ -267,15 +267,15 @@ for (i = 0, last = 0; i <= length - str_len; i++) { if (memcmp(string + i, str_c, str_len)) continue; @try { - tmp = [self resizeMem: tmp - toSize: tmp_len + i - last + - repl_len + 1]; + tmp = [self resizeMemory: tmp + toSize: tmp_len + i - last + + repl_len + 1]; } @catch (OFException *e) { - [self freeMem: tmp]; + [self freeMemory: tmp]; @throw e; } memcpy(tmp + tmp_len, string + last, i - last); memcpy(tmp + tmp_len + i - last, repl_c, repl_len); tmp_len += i - last + repl_len; @@ -282,22 +282,22 @@ i += str_len - 1; last = i + 1; } @try { - tmp = [self resizeMem: tmp - toSize: tmp_len + length - last + 1]; + tmp = [self resizeMemory: tmp + toSize: tmp_len + length - last + 1]; } @catch (OFException *e) { - [self freeMem: tmp]; + [self freeMemory: tmp]; @throw e; } memcpy(tmp + tmp_len, string + last, length - last); tmp_len += length - last; tmp[tmp_len] = 0; - [self freeMem: string]; + [self freeMemory: string]; string = tmp; length = tmp_len; return self; } @end