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

Hide C header implementation details related to actor pad size. #3960

Merged
merged 1 commit into from
Jan 14, 2022

Conversation

jemc
Copy link
Member

@jemc jemc commented Jan 13, 2022

Previously, in the pony.h header that exposes the "public API" of the Pony runtime, information about the size of an actor struct was published as public information.

This change removes that from the public header into a private header, to hide
implementation details that may be subject to change in future versions of the Pony runtime.

This change does not impact Pony programs - only C programs using the pony.h header to use the Pony runtime in some other way than inside of a Pony program, or to create custom actors written in C.


This commit moves the PONY_ACTOR_PAD_SIZE preprocessor value and pony_actor_pad_t struct into actor.h.

@jemc jemc added the changelog - changed Automatically add "Changed" CHANGELOG entry on merge label Jan 13, 2022
@jemc jemc requested a review from a team January 13, 2022 20:37
@jemc jemc self-assigned this Jan 13, 2022
@ponylang-main
Copy link
Contributor

Hi @jemc,

The changelog - changed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.

Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 3960.md to match the number of this pull request.

The basic format of the release notes (using markdown) should be:

## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

Comment on lines -203 to -207
typedef struct pony_actor_pad_t
{
pony_type_t* type;
char pad[PONY_ACTOR_PAD_SIZE];
} pony_actor_pad_t;
Copy link
Member

Choose a reason for hiding this comment

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

why kill off the struct? you are "using it" now in two different locations. seems reasonable to move this into actor.h and then still use it as it was before in cycle.c and actor.c.

Copy link
Member Author

@jemc jemc Jan 13, 2022

Choose a reason for hiding this comment

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

I plan to kill both uses of it in a future PR. Having this type exist whose memory layout is dependent on that pad size is antithetical with the goal we discussed of making the pad size be variable based on configuration settings at LLVM link/optimization time.

If you want me to, I can revert that part of the change in this PR, but even if so, I'm just going to remove it in a future PR.

What is your preference about how to proceed?

Copy link
Member

Choose a reason for hiding this comment

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

Leave now remove later. Feels more contained and easier to understand.

Copy link
Member Author

Choose a reason for hiding this comment

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

@SeanTAllen - The PR has been updated accordingly.

…he Pony runtime, information about the size of an actor struct was published as public information.

This change removes that from the public header into a private header, to hide
implementation details that may be subject to change in future versions of the Pony runtime.

This change does not impact Pony programs - only C programs using the `pony.h` header to use the Pony runtime in some other way than inside of a Pony program, or to create custom actors written in C.

---

This commit moves the `PONY_ACTOR_PAD_SIZE` preprocessor value and `pony_actor_pad_t` struct into `actor.h`.
@SeanTAllen SeanTAllen merged commit 4319be8 into ponylang:main Jan 14, 2022
github-actions bot pushed a commit that referenced this pull request Jan 14, 2022
github-actions bot pushed a commit that referenced this pull request Jan 14, 2022
@jemc jemc deleted the hide-actor-pad branch January 14, 2022 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - changed Automatically add "Changed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants