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

Memory fixes #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Memory fixes #56

wants to merge 2 commits into from

Conversation

MisterDA
Copy link
Collaborator

  • Move macros accessing values outside of blocking sections;
  • Use caml_stat_* functions instead of malloc/free for heap data.

Copy link
Owner

@ygrek ygrek left a comment

Choose a reason for hiding this comment

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

I understand the problem was introduced with #50

what is the motivation for caml_stat_*

int ret = 0;
int flags = caml_convert_flag_list(v_flags, at_flags_table);
flags &= (AT_SYMLINK_NOFOLLOW /* | AT_EMPTY_PATH */); /* only allowed flag here */
caml_enter_blocking_section();
ret = fchownat(Int_val(v_dirfd), String_val(v_name), Int_val(v_owner), Int_val(v_group), flags);
Copy link
Owner

Choose a reason for hiding this comment

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

Int_val is safe, I would be ok to keep to not pollute the scope, but work already done so I guess it is ok

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.

2 participants