This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PR19351, C++] Fix heap overflow in operator new[]


On Mon, Feb 7, 2011 at 6:54 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Mon, Feb 7, 2011 at 12:20 PM, Gabriel Dos Reis
> <gdr@integrable-solutions.net> wrote:
>> On Mon, Feb 7, 2011 at 5:00 AM, Richard Guenther
>> <richard.guenther@gmail.com> wrote:
>>
>>> Btw, I'd really like that C++ people would draft a new entry into libsupc++
>>> that defers size calculation to the library.
>>
>> I had long wondered why the C++ standard did ?not use an interface a
>> la calloc(). ?Oh well.
>>
>>>?Eventually using such
>>> entry would even be ABI compatible(?) and can address the C++0x requirement
>>> of raising a different exception.
>>
>> Note that C++98 also requires a check. ?One problem I see is that the standard
>> requires calling the allocation function (which is a replaceable
>> function, therefore
>> user definable) with a very specific semantics constraint on the first argument.
>> I don't know how you would defer the multiplication and yet remain ABI compliant
>> when the function is repleacable (and also overloadable at class scope!)
>
> Can't we simply supply extra arguments to allow both implementations
> to co-exist under the same name? ?That wouldn't necessarily be a
> big overhead (hopefully calling conventions for the old args do not change
> when adding new ones on all targets ...).

To be sure we are communicating, are we still talking about the allocation
function operator new?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]