这点可以通过汇编验证:
System_Private_CoreLib!System.String.InternalSubString+0xc:00007ffd`9a86132c 418bc8movecx,r8d0:000> tSystem_Private_CoreLib!System.String.InternalSubString+0xf:00007ffd`9a86132f ff15b39f7e00callqword ptr [System_Private_CoreLib+0x9cb2e8 (00007ffd`9b04b2e8)] ds:00007ffd`9b04b2e8={coreclr!AllocateStringFastMP_InlineGetThread (00007ffd`9b20b3a0)}0:000> tcoreclr!AllocateStringFastMP_InlineGetThread:00007ffd`9b20b3a0 4c8b0d090d3400movr9,qword ptr [coreclr!g_pStringClass (00007ffd`9b54c0b0)] ds:00007ffd`9b54c0b0=00007ffd3b6ed698callqword ptr [System_Private_CoreLib+0x9cb2e8 (00007ffd`9b04b2e8)] ds:00007ffd`9b04b2e8={coreclr!AllocateStringFastMP_InlineGetThread (00007ffd`9b20b3a0)}就是直接调用了AllocateStringFastMP_InlineGetThread,然后跳转到后者的地址AllocateStringFastMP_InlineGetThread这个函数的作用实际上是申请内存,比如你 new 一个对象的时候,又或者本例,你需要一个新的字符串对象来存储截取的字符串 。

文章插图
作者:江湖评谈版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可 。

文章插图
经验总结扩展阅读
- 如何在 Inno Setup 中关联多种文件格式
- 东莞有几个高铁站分别在哪里 东莞南高铁站在哪个位置
- 汴梁城是现在的哪个省 汴梁城是如今的什么省份
- 无货源电商在哪个平台开店比较好
- 北京高铁站在哪里
- 2022排灯节是几月几日开始 2022排灯节在什么时候
- 高铁能充电吗二等座 高铁充电器在哪里二等座
- 高铁二等座的充电口在哪里 二等座高铁的充电插座在哪
- 九寨沟有高铁站吗
- 万圣节是每年的哪一天
