Skip to content

Making file handles, context ids, scheme ids type-safer and better self-documented.

Jeremy Soller requested to merge Yoric:cap2 into master

Created by: Yoric

Problem: We're using usize for file descriptors, pids, scheme ids, ... It works, but it's also non-documenting and somewhat footgunish.

Solution: This PR introduces types FileHandle, ContextId, SchemeId, their atomic counterparts and a macro to generate similar types. At runtime, they behave exactly like usize (respectively AtomicUsize), but with added type-safety. This patch covers only the kernel.

State: Ready.

Blockers: Not strictly a blocker, but I expect to build upon this for https://github.com/redox-os/rfcs/pull/2.

Merge request reports