[code-reflection] RFR: [hat] Enable padding in the codegen as an option for the iFace types and Schemas
duke
duke at openjdk.org
Wed Aug 27 13:18:45 UTC 2025
On Wed, 27 Aug 2025 13:10:25 GMT, Juan Fumero <jfumero at openjdk.org> wrote:
> 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 https://github.com/openjdk/babylon/pull/531
@jjfumero
Your change (at version a1fc95af12d2c5a75640f068395a57ea76ff555f) is now ready to be sponsored by a Committer.
-------------
PR Comment: https://git.openjdk.org/babylon/pull/534#issuecomment-3228161833
More information about the babylon-dev
mailing list