Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call finalisers for embedded fields when parent type has no finalizer. #1629

Merged
merged 1 commit into from
Mar 17, 2017

Conversation

Praetonus
Copy link
Member

This fixes a case overlooked in 087ebc7. In that commit, the finaliser of an embedded field was only called if the parent object (or actor) had an explicit finaliser. This change adds implicit finalisers to objects that must finalise an embedded field, including recursively.

PS: If this gets merged before the pending release this shouldn't get a changelog entry since it is covered by the one from #1586.

@Praetonus
Copy link
Member Author

This seems to fail with the same out-of-memory error as #1614. Once #1621 is merged, the problem should be fixed for both PRs.

{
if(ast_id(member) == TK_EMBED)
{
if(embed_has_finaliser(ast_type(member), str_final))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this be refactored to be a part of the above if statement, using &&?

@Praetonus
Copy link
Member Author

I've rebased on latest master to pick up the changes merged from #1621.

embed_has_finaliser(ast_type(member), str_final))
{
return true;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the braces are needed here, and the indentation is a bit off.

dipinhora added a commit to dipinhora/ponyc that referenced this pull request Mar 9, 2017
This commit changes how the Windows memory allocation/commitment
is done by switching from committing all memory immediately
to only committing memory dynamically as it gets allocated.

This resolves the Windows errors that PR ponylang#1614 and PR ponylang#1629 have
been encountering related to `ponyint_virt_alloc` and `The paging
file is too small for this operation to complete.`
@SeanTAllen SeanTAllen force-pushed the master branch 6 times, most recently from 97b1943 to 21d37aa Compare March 11, 2017 14:51
@Praetonus
Copy link
Member Author

I've rebased on latest master after the merge of #1677.

@Praetonus
Copy link
Member Author

The new tests are causing a segfault on Linux and I can't reproduce it. I'll try to investigate.

@Praetonus Praetonus added the do not merge This PR should not be merged at this time label Mar 17, 2017
This fixes a case overlooked in 087ebc7. In that commit, the finaliser
of an embedded field was only called if the parent object (or actor)
had an explicit finaliser. This change adds implicit finalisers to
objects that must finalise an embedded field, including recursively.
@Praetonus
Copy link
Member Author

The tests are passing. I've also made the changes you requested @jemc.

@Praetonus Praetonus removed the do not merge This PR should not be merged at this time label Mar 17, 2017
@jemc jemc changed the title Really always call finalisers for embedded fields Call finalisers for embedded fields when parent type has no finalizer. Mar 17, 2017
@jemc jemc added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Mar 17, 2017
@jemc jemc merged commit 853c3e7 into ponylang:master Mar 17, 2017
ponylang-main added a commit that referenced this pull request Mar 17, 2017
@Praetonus Praetonus deleted the gen-final-embed branch March 18, 2017 00:07
georgemarrows added a commit to georgemarrows/ponyc that referenced this pull request Jun 28, 2017
Praetonus pushed a commit that referenced this pull request Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants