--- parser3/src/main/pa_charset.C 2002/12/23 08:03:03 1.32 +++ parser3/src/main/pa_charset.C 2003/03/17 14:48:05 1.33.4.1 @@ -1,11 +1,11 @@ /** @file Parser: Charset connection implementation. - Copyright(c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Copyright(c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan(http://paf.design.ru) */ -static const char* IDENT_CHARSET_C="$Date: 2002/12/23 08:03:03 $"; +static const char* IDENT_CHARSET_C="$Date: 2003/03/17 14:48:05 $"; #include "pa_charset.h" @@ -456,7 +456,7 @@ void Charset::transcodeToUTF8(Pool& pool const void *source_body, size_t source_content_length, const void *& adest_body, size_t& dest_content_length) const { dest_content_length=source_content_length*6/*so that surly enough, max utf8 seq len=6*/; - XMLByte *dest_body=(XMLByte*)pool.malloc(dest_content_length); + XMLByte *dest_body=(XMLByte*)pool.malloc_atomic(dest_content_length); if(::transcodeToUTF8( (XMLByte *)source_body, source_content_length, @@ -473,7 +473,7 @@ void Charset::transcodeFromUTF8(Pool& po const void *source_body, size_t source_content_length, const void *& adest_body, size_t& dest_content_length) const { dest_content_length=source_content_length*6/*so that surly enough, "ÿ" has max ratio */; - XMLByte *dest_body=(XMLByte*)pool.malloc(dest_content_length); + XMLByte *dest_body=(XMLByte*)pool.malloc_atomic(dest_content_length); if(::transcodeFromUTF8( (XMLByte *)source_body, source_content_length, @@ -497,7 +497,7 @@ void Charset::transcodeToCharset(Pool& p adest_content_length=source_content_length; } else { size_t dest_content_length=source_content_length; - unsigned char *dest_body=(unsigned char *)pool.malloc(dest_content_length); + unsigned char *dest_body=(unsigned char *)pool.malloc_atomic(dest_content_length); const XMLByte* srcPtr=(XMLByte *)source_body; const XMLByte* srcEnd=(XMLByte *)source_body+source_content_length; @@ -572,7 +572,7 @@ const char *Charset::transcode_cstr(xmlC int inlen=strlen((const char *)s); int outlen=inlen+1; // max - char *out=(char *)malloc(outlen*sizeof(char)); + char *out=(char *)malloc_atomic(outlen*sizeof(char)); int error; if(xmlCharEncodingOutputFunc output=transcoder(0)->output) { @@ -621,14 +621,14 @@ xmlChar *Charset::transcode_buf2xchar(co int error; if(xmlCharEncodingInputFunc input=transcoder(0)->input) { outlen=buf_size*6/*max*/; - out=(unsigned char*)malloc((outlen+1)*sizeof(unsigned char)); + out=(unsigned char*)malloc_atomic((outlen+1)*sizeof(unsigned char)); error=input( out, &outlen, (const unsigned char *)buf, (int *)&buf_size, transcoder(0)->inputInfo); } else { outlen=buf_size; - out=(unsigned char*)malloc((outlen+1)*sizeof(unsigned char)); + out=(unsigned char*)malloc_atomic((outlen+1)*sizeof(unsigned char)); memcpy(out, buf, outlen); error=0; }