Skip to content

extend materials segfaults #32

Description

@gridley

Material* tmp = static_cast<Material*>(malloc(n * sizeof(Material)));

You can see that this segfaults pretty straightforwardly. It mallocs n materials, but we actually need materials_size + n.

If we let this sit for a bit, I have an implementation coming that fixes this and uses std::realloc for potential efficiency improvement. It also makes a few of the commonly used classes trivially copyable. Currently resolving a few other problems.

Lesson learned: in any future GPU-portable implementation, we must avoid managing memory by hand at all costs since it is so error prone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions