stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <>
Subject RE: design of testuite exceptions (was: Re: svn commit: r418319 - /incubator/stdcxx/trunk/tests/strings/
Date Mon, 17 Jul 2006 15:51:37 GMT

> -----Original Message-----
> From: Martin Sebor [] 
> Sent: Sunday, July 16, 2006 11:46 PM
> To:
> Subject: Re: design of testuite exceptions (was: Re: svn 
> commit: r418319 - 
> /incubator/stdcxx/trunk/tests/strings/
> PS One thing to look into is formatting the text of the 
> exception's what string directly into the what_ buffer 
> instead dynamically allocating it only to free it later.

> I believe rw_asnprintf has the ability to use the provided 
> buffer if it's large enough.

  Unfortunately, rw_asnprintf cannot use buffer with automatic or static
rw_asnprintf calls rw_vasnprintf which calls _rw_bufcat. If the buffer
size is too small
the _rw_bufcat allocates the memory using malloc() and unconditionally
calls free() for
the old buffer. Moreover the _rw_bufcat allocates the memory including
the guard block
(printf.cpp line 425) and even if the initial buffer was allocated using
RW_ASSERT (printf.cpp line 461) will terminate the execution in the


View raw message