Noalias pragma
Since version 1.4 of the Nim compiler, there is a .noalias annotation for variables and parameters. It is mapped directly to C/C++’s restrict keyword and means that the underlying pointer is pointing to a unique location in memory, no other aliases to this location exist. It is unchecked that this alias restriction is followed. If the restriction is violated, the backend optimizer is free to miscompile the code. This is an unsafe language feature.
Ideally in later versions of the language, the restriction will be enforced at compile time. (This is also why the name noalias was chosen instead of a more verbose name like unsafeAssumeNoAlias.)
当前内容版权归 nim-lang.org 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 nim-lang.org .