Skip to content

Debug-only dynamic checks for layout and GC use of DOMRefCell - #3797

Merged
bors-servo merged 6 commits into
servo:masterfrom
kmcallister:domrefcell
Oct 25, 2014
Merged

bors-servo merged 6 commits into
servo:masterfrom
kmcallister:domrefcell

Conversation

@kmcallister

Copy link
Copy Markdown
Contributor

r? @mbrubeck, @jdm

Alternative to #3770 and #3716.

@hoppipolla-critic-bot

Copy link
Copy Markdown

Critic review: https://critic.hoppipolla.co.uk/r/2962

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@jdm

jdm commented Oct 24, 2014

Copy link
Copy Markdown
Member

I see the benefits of duplicating RefCell for the time being, and I appreciate the strictness of the checks here. I think we'll go with this version over the implementation in #3770.

This gets rid of a dubious transmute:

    let val = mem::transmute::<&RefCell<T>, &T>(&self.base);

The code duplication will be reduced once rust-lang/rust#18131 is fixed.
Adds some other dynamic checks in debug builds.
debug_assert! uses

    if cfg!(not(ndebug)) { ... }

so the body in a release build is dead code, but it still needs to compile.
@kmcallister

Copy link
Copy Markdown
Contributor Author

Whoops, this broke release builds. @mbrubeck, @jdm, would one of you mind reviewing the two new commits, which fix this issue?

bors-servo pushed a commit that referenced this pull request Oct 25, 2014
@bors-servo bors-servo closed this Oct 25, 2014
@bors-servo
bors-servo merged commit f508a82 into servo:master Oct 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants