This is the mail archive of the gcc@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: Integer overflow in operator new


rridge@csclub.uwaterloo.ca (Ross Ridge) writes:

| Joe Buck writes:
| >If a check were to be implemented, the right thing to do would be to throw
| >bad_alloc (for the default new) or return 0 (for the nothrow new).
| 
| What do you do if the user has defined his own operator new that does
| something else?

More precisely?

| >There cases where the penalty for this check could have
| >an impact, like for pool allocators that are otherwise very cheap.
| >If so, there could be a flag to suppress the check.
| 
| Excessive code size growth could also be problem for some programs.

Those programs willing to do anything to avoid imagined or perceived
"excessive code size growth" may use the suggested switch.

-- Gaby


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