H
HeroOfSpielburg
I'm writing a memory manager and overloading the operators "::new" and
"::delete" I know this isn't always the smartest thing to do, but
regardless, I was wondering what sort of considerations I should be
making when writing the array-based versions "new[]" and "delete[]"
(in contrast to the single item "new" and "delete").
I know the fundamental issue between ensuring "new[]" is matched with
"delete[]" is making sure the destructor for each of the items in the
dynamically-allocated array is called (as opposed to just the first if
only "delete" were called). If I'm just getting a pointer to the
beginning of said array when "delete[]" is called, how do I handle
this properly?
Thanks in advance.
Dave
"::delete" I know this isn't always the smartest thing to do, but
regardless, I was wondering what sort of considerations I should be
making when writing the array-based versions "new[]" and "delete[]"
(in contrast to the single item "new" and "delete").
I know the fundamental issue between ensuring "new[]" is matched with
"delete[]" is making sure the destructor for each of the items in the
dynamically-allocated array is called (as opposed to just the first if
only "delete" were called). If I'm just getting a pointer to the
beginning of said array when "delete[]" is called, how do I handle
this properly?
Thanks in advance.
Dave