惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Schneier on Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Latest news
Latest news
H
Help Net Security
雷峰网
雷峰网
Spread Privacy
Spread Privacy
Cyberwarzone
Cyberwarzone
Project Zero
Project Zero
Security Latest
Security Latest
Know Your Adversary
Know Your Adversary
人人都是产品经理
人人都是产品经理
P
Privacy & Cybersecurity Law Blog
M
MIT News - Artificial intelligence
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
U
Unit 42
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
博客园 - 三生石上(FineUI控件)
Stack Overflow Blog
Stack Overflow Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
S
Securelist
S
Security @ Cisco Blogs
T
Threatpost
P
Palo Alto Networks Blog
C
Check Point Blog
V
Vulnerabilities – Threatpost
T
Tailwind CSS Blog
B
Blog RSS Feed
Recorded Future
Recorded Future
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
P
Proofpoint News Feed
P
Privacy International News Feed
AWS News Blog
AWS News Blog
博客园 - 叶小钗
WordPress大学
WordPress大学

博客园 - Zhenway

Azure SignalR支持replication啦 Azure SignalR总览 定制json序列化 今天折腾这么一个正则 docfx组件介绍--YamlSerialization docfx daylybuild docfx开源啦 docfx组件介绍--MarkdownLite docfx预热中 合并批量请求 一个简单的Linq to TreeNode 在finally中调用一个需要await的方法 当泛型方法推断,扩展方法遇到泛型类型in/out时。。。 一个非常简单的反射加速方案 加载时预防并发执行 又发现一个msdn的坑 又发现个.net framework的坑 sql server死锁神器 踩到一个Emit的坑,留个纪念
4.5你太黑了,不带这么玩TypeForwardedTo的
Zhenway · 2014-02-25 · via 博客园 - Zhenway

话说最近好不容易把framework 4.0的metadata信息都能全部抽出了,结果换4.5挂了。。。framework那帮人在4.5里面用了些什么诡异的玩意?

结果一看4.5的部分field用了typed function pointer这个诡异的类型,好吧,还好之前留好空挡了,就等有空的时候去填空,现在就乖乖的补上实现,最多麻烦点,field signature里面放个类型,类型里面可以选typed function pointer,typed function pointer里面有个method signature,method signature里面继续有类型,当然类型里面要是他们高兴继续可以来个typed function pointer。。。稀里哗啦的敲上一堆代码,跑下单元测试,过了,很开心的再测试一下整个4.5,结果。。。挂了,报错是在System.Runtime.dll里找不到System.ValueType。。。

这是什么情况?!System.ValueType当然不在这里,应该在mscorlib里面,一看报错的地方是System.Runtime.xxxx.dll,无语,看看这个dll没啥特殊的,一时之间也晕掉了。

瞎摸索了一阵,无意间反编译了下System.Runtime.dll,被惊呆了,这个dll里面没有一行代码,只有一堆TypeForwardedTo,常用类型都有一个,基础到System.Int32、System.String、System.Void,还有各种Action和Func,方式常用的都来一份。。。

TypeForwardedTo这个特性本来是为了无缝升级framework用的,没想到4.5那帮人竟然直接拿它当别名用,这下这边的代码可算是被它坑死了,也不得不去识别这个特性,查找类型时也需要多留个心眼,这个复杂度。。。哎。。。郁闷。。。