Skip to content

Reserve handle 0 #282

Closed
Closed
@badeend

Description

@badeend

to be an always-invalid "NULL" handle?

Two benefits that come to mind for client languages:

  • easy to spot usage of uninitialized fields. Trying to use an uninitialized 0 field as a handle would then cause an error, instead of silently using the first resource.
  • enables optional handles to be stored with zero overhead. Similar to Rust's option null pointer optimization (Option<NonZeroU32>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions