Skip to content

runtime: malloc flags should be subsumed by the type information provided to mallogc #6237

@lexprfuncall

Description

@lexprfuncall
Today, we pass flags to malloc to help it decide what constraints are required on the
storage allocated for an object.  However, all of this information can be derrived from
the type of an object.

For example, instead of passing the "not pointers" flag mallocgc can do a
"no pointers" allocation whenever it is passed a type which contains no point
values.

There are some flags which cannot be subsumed by the type information, this includes the
zeroing flag (sometimes we know we are going to initialize an object and do not need
zeroing) and the no invoke gc flag.  The "no gc" flag is a gray area, in
theory types could encode this information (for example, mspans, stacks) but today those
kinds of allocation have no type.  Maybe they should.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions