ICU-5320 Don't use global new and delete

X-SVN-Rev: 20063
This commit is contained in:
George Rhoten 2006-08-15 06:45:05 +00:00
parent f784e6f443
commit 5c6df5e87f
3 changed files with 4 additions and 4 deletions

View file

@ -140,7 +140,7 @@ CharsetDetector::CharsetDetector()
{
setRecognizers();
resultArray = new CharsetMatch *[fCSRecognizers_size];
resultArray = (CharsetMatch **)uprv_malloc(sizeof(CharsetMatch *)*fCSRecognizers_size);
for(int32_t i = 0; i < fCSRecognizers_size; i += 1) {
resultArray[i] = new CharsetMatch();
@ -155,7 +155,7 @@ CharsetDetector::~CharsetDetector()
delete resultArray[i];
}
delete [] resultArray;
uprv_free(resultArray);
}
void CharsetDetector::setText(const char *in, int32_t len)

View file

@ -27,7 +27,7 @@ U_NAMESPACE_BEGIN
// stripped of markup. Detection only considers multi-byte chars, effectively
// stripping markup anyway, and double byte chars do occur in markup too.
//
class IteratedChar
class IteratedChar : public UMemory
{
public:
int32_t charValue; // 1-4 bytes from the raw input data

View file

@ -56,7 +56,7 @@ void InputText::setDeclaredEncoding(const char* encoding, int32_t len)
{
if(encoding) {
len += 1; // to make place for the \0 at the end.
delete[] fDeclaredEncoding;
uprv_free(fDeclaredEncoding);
fDeclaredEncoding = NEW_ARRAY(char, len);
uprv_strncpy(fDeclaredEncoding, encoding, len);
}