Merge lp://staging/~marcustomlinson/v8-cpp/test-gc into lp://staging/v8-cpp

Proposed by Marcus Tomlinson
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 34
Merged at revision: 28
Proposed branch: lp://staging/~marcustomlinson/v8-cpp/test-gc
Merge into: lp://staging/v8-cpp
Diff against target: 533 lines (+222/-88)
7 files modified
src/internal/class.h (+102/-39)
src/internal/convert.h (+35/-27)
src/run.h (+5/-0)
tests/objects/module.cpp (+2/-0)
tests/objects/test.cpp (+59/-16)
tests/objects/test.h (+17/-5)
valgrind.supp (+2/-1)
To merge this branch: bzr merge lp://staging/~marcustomlinson/v8-cpp/test-gc
Reviewer Review Type Date Requested Status
Alexandre Abreu (community) Approve
Review via email: mp+269594@code.staging.launchpad.net

Commit message

Added support for shared_ptr and unique_ptr

To post a comment you must log in.
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

small comment inline

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Replied to inline comments.

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

replied

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

> replied

Ok I see what you're saying. I'll try specifically set the internal field counts to 2 and 3 for non-shared_ptr and shared_ptr objects respectively.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Hmmm, so I've untangled my thoughts and realised again why it has to remain implemented this way.

The internal field count is set when creating the class template. This template is what we use to mould instances of the class as they are created. We only manage exported class types, even in the case of smart pointers, we are actually instantiating the underlying class type template and appending the extra smart pointer reference as the 3rd internal field.

Seeing that we need our class templates to support both normal instances as well as smart pointer instances, we have to make that 3rd internal field available in all of our templates as either variant may be constructed from them.

Hope I'm making sense?

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> Hmmm, so I've untangled my thoughts and realised again why it has to remain
> implemented this way.
>
> The internal field count is set when creating the class template. This
> template is what we use to mould instances of the class as they are created.
> We only manage exported class types, even in the case of smart pointers, we
> are actually instantiating the underlying class type template and appending
> the extra smart pointer reference as the 3rd internal field.
>
> Seeing that we need our class templates to support both normal instances as
> well as smart pointer instances, we have to make that 3rd internal field
> available in all of our templates as either variant may be constructed from
> them.
>
> Hope I'm making sense?

totally,

mmh changing that would require quite a bit of "redoing", we might as well leave this as is, and update it if necessary,

Revision history for this message
Alexandre Abreu (abreu-alexandre) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: