Blittable 值类型

发布于 2024-08-26 05:10:20 字数 232 浏览 4 评论 0原文

以下是 blittable 类型的列表。它包含 Int32 和 Int64。但我在列表中没有看到简单的“int”。 C# 如何处理普通的“int”类型?它只是根据系统替换为 Int32 或 Int64 吗?还是有细微的差别?使用“int”是否会导致编组性能下降?

Here is a list of blittable types. It contains Int32 and Int64. But I don't see just plain "int" on the list. How does C# treat the plain "int" type? Does it just get replaced with Int32 or Int64 depending on the system? Or is there a subtle difference? Will using "int" ever cause a performance hit for marshalling?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

如梦 2024-09-02 05:10:20

intInt32 的别名。所以不,使用其中一种与另一种时不会影响性能。

int is an alias for Int32. So no, there won't be a performance hit when using one vs. the other.

静谧幽蓝 2024-09-02 05:10:20

int 是映射到 System.Int32 结构的 C# 关键字。没有计划(据我所知)将其迁移到 Int64。

int is a C# keyword that maps to the System.Int32 struct. There are no plans (AFAIK) to migrate it to Int64.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文