Skip to content

Conversation

jjfumero
Copy link
Member

@jjfumero jjfumero commented Aug 27, 2025

This PR extends the C99 code generator to allow the generation of padding if this option is specified in the Hat Data Type Schema.

For instance:

Schema<F32Array> schema = Schema.of(F32Array.class, f32Array->f32Array
            .arrayLen("length").pad(12).array("array"));

Generates this C99 struct:

typedef struct F32Array_s{
    int length;
    char pad$ZArmN[12];   // pad$ + 5 random letter to avoid accidental collision with other members of the buffer type
    float array[1];
}F32Array_t;

This change is required to enable efficient local memory: See #531


Progress

  • Change must not contain extraneous whitespace

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/babylon.git pull/534/head:pull/534
$ git checkout pull/534

Update a local copy of the PR:
$ git checkout pull/534
$ git pull https://git.openjdk.org/babylon.git pull/534/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 534

View PR using the GUI difftool:
$ git pr show -t 534

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/babylon/pull/534.diff

Using Webrev

Link to Webrev Comment

@jjfumero
Copy link
Member Author

/integrate

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 27, 2025

👋 Welcome back jfumero! A progress list of the required criteria for merging this PR into code-reflection will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 27, 2025

@jjfumero This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

[hat] Enable padding in the codegen as an option for the iFace types and Schemas

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the code-reflection branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Aug 27, 2025
@openjdk
Copy link

openjdk bot commented Aug 27, 2025

@jjfumero
Your change (at version a1fc95a) is now ready to be sponsored by a Committer.

@mlbridge
Copy link

mlbridge bot commented Aug 27, 2025

Webrevs

@grfrost
Copy link
Collaborator

grfrost commented Aug 27, 2025

/integrate

@openjdk
Copy link

openjdk bot commented Aug 27, 2025

@grfrost Only the author (@jjfumero) is allowed to issue the integrate command. As this pull request is ready to be sponsored, and you are an eligible sponsor, did you mean to issue the /sponsor command?

@grfrost
Copy link
Collaborator

grfrost commented Aug 27, 2025

/sponsor

@openjdk
Copy link

openjdk bot commented Aug 27, 2025

Going to push as commit cad3fdf.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 27, 2025
@openjdk openjdk bot closed this Aug 27, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Aug 27, 2025
@openjdk
Copy link

openjdk bot commented Aug 27, 2025

@grfrost @jjfumero Pushed as commit cad3fdf.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@jjfumero jjfumero deleted the hat/padding/codegen branch August 27, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants