public class testGC : MonoBehaviour
{
class XDict<K, V>
{
public void TryGetValue(K key, V value)
{
if(key == null) //产生 GC-ALLOC,因为实参为int,而 null是引用类型,发生了装箱操作
{
}
}
} XDict<int, string> mDict = new XDict<int, string>(); void Start()
{
} void Update()
{
var key = ;
if (key != null) //不会产生GC-ALLOC
{
var value = ;
} mDict.TryGetValue(, "hello");
}
}

最新文章

  1. servlet jsp jdbc bootstrarp mvc分层模式实现的第一个项目
  2. js事件代理(委托)
  3. css中的display以及position属性
  4. 【转】Fiddler的基本介绍
  5. [开发笔记]-使用jquery获取url及url参数的方法
  6. 你有没有试过“闭上眼”使用:京东、滴滴、QQ、支付宝?
  7. UVA 658 It&#39;s not a Bug, it&#39;s a Feature! (最短路,经典)
  8. 【C#学习笔记】Dictionary容器使用
  9. topcoder算法练习3
  10. BZOJ 1011 [HNOI2008]遥远的行星
  11. 清除大文本中的html标签
  12. 转载:struts标签&lt;s:date&gt;的使用
  13. 超过lua上帝的语言
  14. 工欲善其事,必先利其器之open live writer写作
  15. [译]ASP.NET Core 2.0 机密配置项
  16. windows NLB实现MSSQL读写分离--从数据库集群读负载均衡
  17. Android 推送和统计最优轮循(心跳策略)探究实践
  18. Task.Wait and “Inlining”
  19. python模块部分----模块、包、常用模块
  20. try、catch、finally详解,你不知道的异常处理

热门文章

  1. android-menudrawer 和SlidingMenu 用法
  2. Quidway S系列交换机
  3. Java常用的线程池
  4. 十三篇系列:king转折点,wooga瓶颈,supercell营收结构
  5. GRUB2 命令行使用笔记
  6. IIS 禁止回收
  7. SQL Server 2016:内存列存储索引
  8. Windows Server 2012R2 网络地址转换NAT
  9. 内存大小设置 Java heap space错误
  10. es6(8)--对象