Skip to content

Add support for aligned memory alloc/realloc/free in GDExtension #12336

@iiMidknightii

Description

@iiMidknightii

Describe the project you are working on

A fluid simulation written in GDExtension that tries to make use of compiler vectorization for performance.

Describe the problem or limitation you are having in your project

The Memory class in Godot currently allows for managing aligned memory through the use of alloc_aligned_static, etc. However, these methods are not exposed to the GDExtension interface like the default ones.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

I propose GDExtensionInterface gains access to those methods. On the other side, godot-cpp would also need to be updated to add the other side of the interface as well.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

It's probably as simple as adding the new methods and implementing them similarly to how the existing non-aligned methods behave. I could probably implement it myself if I knew a little more about the internals of GDExtensionInterface. I think I have a handle on the godot-cpp side, but haven't found the actual implementation of that on the engine side.

If this enhancement will not be used often, can it be worked around with a few lines of script?

It's part of the extension interface so no scripting could tackle this.

Is there a reason why this should be core and not an add-on in the asset library?

I don't think you can modify the extension interface in an add-on.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions