Re: new/delete overloading, why?

From: Robert Collins <robertc_at_robertcollins.net>
Date: Sat, 21 Aug 2010 07:02:34 +1200

2010/8/21 Henrik Nordström <henrik_at_henriknordstrom.net>:
> Why are we overloading new/delete with xmalloc/xfree?
>
>   include/SquidNew.h
>
> this is causing "random" linking issues every time some piece of code
> forgets to include SquidNew.h, especially when building helpers etc. And
> I fail to see what benefit we get from overloading the new/delete
> operators in this way.

it was to stop crashes with code that had been cast and was freed with
xfree(); if you don't alloc with a matching allocator, and the
platform has a different default new - *boom*.

There may be nothing like that left to worry about now.

-Rob
Received on Fri Aug 20 2010 - 19:02:41 MDT

This archive was generated by hypermail 2.2.0 : Sat Aug 21 2010 - 12:00:04 MDT