This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: pool allocator changes and delete[] void*


"Gawain Bolton" <gp.bolton@computer.org> writes:

| I'm not understanding something here.  Why replace "new char[n]" with
| "static_cast<char *>(::operator new(n))"?  It seems to me this is less
| readable, less obvious and therefore less maintainable.

What is less maintainable about?

| What's the justification for such obfuscation?

I have exactly the opposite view:  The previous was incorrect and
obscure. 

| I'm also not convinced that the memory deallocation will correctly
| deallocate the memory allocated.

Because?

| It's not clear to me that operator
| new(size_t) and operator delete(void *) are inverse functions.

They are.  See 3.7.2 and 3.7.3

-- Gaby


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