| commit | dea8b3c5711d5e4b64dc0c9b06ebd885ed960ab0 | [log] [tgz] |
|---|---|---|
| author | Joshua Liebow-Feeser <joshlf@fuchsia.infra.roller.google.com> | Thu Aug 19 03:32:35 2021 +0000 |
| committer | Copybara-Service <copybara-worker@google.com> | Wed Aug 18 20:34:20 2021 -0700 |
| tree | 117e96983ba1c1b6e24b12aaf018c21bc4fdbaf4 | |
| parent | 2190828dbc5186adaa3bd7898b418d930754da7d [diff] |
[roll] Roll fuchsia [zerocopy] Add transmute! macro Add the `transmute!` macro, which is a memory-safe equivalent of the `core::mem::transmute` function. The `transmute!` macro requires that its argument is `AsBytes`, and produces a value of a type which must be `FromBytes`. The two types must be of the same size. The reason that this needs to be a macro and cannot be a function is that there's currently no way to express in the type system the requirement that two generic types must have the same size. The macro is able to make use of the fact that `core::mem::transmute` (which `transmute!` uses internally) is special-cased in the compiler, and can thus use compiler magic to ensure that the two types have the same size. As a result, `transmute!` can only be used in a context in which both types are concrete types rather than generic type variables. Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/569463 Original-Revision: 14b5ba00c9c19671b7b4e55f03f0c000d145a7ea GitOrigin-RevId: ec618137d3b01116ce2c4baca086fad3b7193441 Change-Id: I3c94a092712990f96407b38b2244be64a5210a78
This repository contains Fuchsia's Global Integration manifest files.
All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.
Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.
First install Jiri.
Next run:
$ jiri init $ jiri import minimal https://fuchsia.googlesource.com/integration $ jiri update
Third party projects should have their own subdirectory in ./third_party.