https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h
File src/smart-pointers.h (right):

https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h#newcode54
src/smart-pointers.h:54: ~SmartPointerBase() { if (p_)
Deallocator::Delete(p_); }
On 2013/12/04 07:34:01, yurys wrote:
This is a good question. I believe the problem is that
SmartArrayPointer and
SmartPointer inherit from SmartPointerBase. This could be solved e.g.
by making
SmartPointer a template with single parameter T. Then it may use
Deallocator as
type traits internally, Deallocator in turn can be specialized for
array types.
This way we could use SmartPointer for both array types and scalar
types.

It may make sense to replace current implementation of SmartPointer
with one
from Blink or Chromium where all such problems have already been
solved. WDYT?

I think this class is actually trying to be a (poor & buggy) replacement
for std::unique_ptr, perhaps we can use that instead. If there is some
portability problem, we could at least try to mimic unique_ptr's
interface, so we can switch easily in the future.

I am not sure what Chrome provides and if there are any portability
problems, but I think Jochen knows (adding him)...

https://codereview.chromium.org/101763003/

--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to