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

fix: remove R_SEXP_to_hrg use R_SEXP_to_hrg_copy to avoid memory leak #1075

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

Antonov548
Copy link
Contributor

@Antonov548 Antonov548 commented Jan 4, 2024

Closes #1073

Copy link
Contributor

aviator-app bot commented Jan 4, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.

Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@Antonov548 Antonov548 requested review from krlmlr and szhorvat January 4, 2024 08:55
INOUT: |-
if (0 != R_SEXP_to_hrg_copy(%I%, &%C%)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
igraph_error("internal error in R_SEXP_to_hrg_copy()", __FILE__, __LINE__, IGRAPH_ENOMEM);
Copy link
Member

Choose a reason for hiding this comment

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

this one needs a fix too and then regenerate

Copy link
Contributor

Choose a reason for hiding this comment

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

@Antonov548: Can you please tweak according to Szabolcs's comments?

@maelle
Copy link
Contributor

maelle commented Jan 16, 2024

@Antonov548 friendly reminder of #1075 (comment) 😸

@@ -76,6 +76,21 @@ CSTRING:
OUT: |-
PROTECT(%I% = Rf_mkCharLenCE(%C%, strlen(%C%), CE_UTF8));

DOUBLE:
Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of this type and where it is used in functions.yaml? It should always be the same as REAL.

Copy link
Member

Choose a reason for hiding this comment

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

OK, I see it's for igraph_almost_equals and igraph_cmp_epsilon, but these are not really meant to be exposed in high-level interfaces.

@ntamas, does Stimulus have some features already to reduce the code duplication between DOUBLE and REAL?

Copy link
Member

Choose a reason for hiding this comment

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

Nope :(

@szhorvat
Copy link
Member

@krlmlr @Antonov548 This PR has started to diverge form its original purpose. Would it be better to merge it and add unrelated fixes to independent PRs?

@Antonov548
Copy link
Contributor Author

@krlmlr @Antonov548 This PR has started to diverge form its original purpose. Would it be better to merge it and add unrelated fixes to independent PRs?

As soon as you happy with changes. I also think that this PR already following not the main goal.

@szhorvat
Copy link
Member

I'm happy.

@Antonov548 Antonov548 requested a review from krlmlr January 17, 2024 16:20
@krlmlr krlmlr force-pushed the fix/hrg-conversion-leak branch from f6779f6 to c4b6541 Compare January 20, 2024 12:29
@krlmlr krlmlr mentioned this pull request Jan 20, 2024
@aviator-app aviator-app bot merged commit 3c1d544 into main Jan 20, 2024
25 checks passed
@aviator-app aviator-app bot deleted the fix/hrg-conversion-leak branch January 20, 2024 12:58
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory allocated by R_SEXP_to_hrg() is not deallocated
5 participants