随笔分类 -  C#

摘要:关于LOH(Large Object Heap)的。 .NET CLR中对于大于85000字节的内存既不像引用类型那样分配到普通堆上,也不像值类型那样分配到栈上,而是分配到了一个特殊的称为LOH的内部堆上,这部分的内存只有在GC执行完全回收,也就是回收二代内存的时候才会回收。因此,考虑如下情形: 假 阅读全文
posted @ 2017-09-22 12:44 时空观察者9号 阅读(650) 评论(0) 推荐(0)
摘要:Terms VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) RSS- Resident Set Size 实际使用物理内存(包含共享库占用的内存) PSS- Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存) USS- Uni 阅读全文
posted @ 2017-08-29 11:36 时空观察者9号 阅读(247) 评论(0) 推荐(0)
摘要:void Awake() { SceneManager.sceneLoaded += SceneManager_sceneLoaded; } Scene xscen; //文档说明:SceneManager.sceneLoaded // Add a delegate to this to get notifications whe... 阅读全文
posted @ 2017-08-09 16:19 时空观察者9号 阅读(501) 评论(0) 推荐(0)
摘要:1 public class testwriter : MonoBehaviour { 2 3 // Use this for initialization 4 void Start () { 5 6 } 7 8 [MenuItem("Testx/test")] 9 static void test() 10... 阅读全文
posted @ 2017-07-21 16:53 时空观察者9号 阅读(578) 评论(0) 推荐(0)
摘要:http://www.360doc.com/content/15/0717/09/10504424_485422031.shtml 阅读全文
posted @ 2017-06-29 19:00 时空观察者9号 阅读(290) 评论(0) 推荐(0)
摘要:var t1 = Profiler.GetMonoHeapSize()/div; var t2 = Profiler.GetMonoUsedSize() / div; var t3 = Profiler.GetTotalAllocatedMemory() / div; var t4 = Profiler.GetTempAllocat... 阅读全文
posted @ 2017-06-28 15:59 时空观察者9号 阅读(292) 评论(0) 推荐(0)
摘要:using System; using System.Runtime.InteropServices; using System.IO; namespace tx { struct ST { public byte c1; public float x; public int y; } class Ct { ... 阅读全文
posted @ 2017-06-18 13:05 时空观察者9号 阅读(490) 评论(0) 推荐(0)
摘要:Marshal对应的实现ByteToStruct,及效率对比完整程序如下:以读取魔兽世界M2文件为例,经测试发现ByteToStruct用时为MemCopy的3倍到4倍 阅读全文
posted @ 2017-06-17 18:13 时空观察者9号 阅读(9255) 评论(0) 推荐(0)
摘要:理解委托最重要的一点是:委托是一个函数指针,应该将一个函数赋给它。这个函数可以是一个函数名,或一个临时定义的匿名函数,如上。 阅读全文
posted @ 2017-06-06 16:51 时空观察者9号 阅读(290) 评论(0) 推荐(0)
摘要:问题记录:如何比较两个字符串的相似度 阅读全文
posted @ 2017-04-12 11:15 时空观察者9号 阅读(290) 评论(1) 推荐(1)
摘要:static void Main(string[] args) { MemoryStream ms = new MemoryStream(); BinaryWriter bw = new BinaryWriter(ms); int ix0 = 0x12341314;//注意 int ... 阅读全文
posted @ 2017-02-08 11:36 时空观察者9号 阅读(410) 评论(0) 推荐(0)
摘要:prefab可无限apply: 如果把一个模块做成了prefab,这个prefab可能在同一个scene中添加多个,甚至添加到了多个scene中。设所有这些实例为instance(1),instance(2),...,instance(n),那么我们应该保证对于任何一个instance(i)来说,对 阅读全文
posted @ 2017-01-05 10:53 时空观察者9号 阅读(305) 评论(0) 推荐(0)
摘要:test1.lua 阅读全文
posted @ 2016-12-28 16:09 时空观察者9号 阅读(665) 评论(0) 推荐(0)
摘要:using System; namespace abc.e.f//等价于下面分层嵌套的写法。且这种写法不管命名空间abc有没有定义过,也不管命名空间e有没有定义过 { class MYTestX { static void Main(string[] args) { int[,] matrix = new int[2, 5... 阅读全文
posted @ 2016-12-13 22:52 时空观察者9号 阅读(3162) 评论(0) 推荐(0)
摘要:1,3D Game Engine Programming 2, 3, 4, 5, 阅读全文
posted @ 2016-12-13 12:04 时空观察者9号 阅读(238) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2016-12-06 16:55 时空观察者9号 阅读(5) 评论(0) 推荐(0)
摘要:namespace abc.e.f//等价于下面分层嵌套的写法。且这种写法不管命名空间abc有没有定义过,也不管命名空间e有没有定义过 { class ctest { public void func() { Console.WriteLine("abc.e.f.ctest.func"); } } }... 阅读全文
posted @ 2016-12-04 17:10 时空观察者9号 阅读(627) 评论(0) 推荐(0)
摘要:1 using System; 2 class MYTestX 3 { 4 class CT 5 { 6 } 7 class CO 8 { 9 public CT ott; //默认是null 10 public string strx;//默认也是null,而不是空串"" 11 publ... 阅读全文
posted @ 2016-11-29 22:09 时空观察者9号 阅读(2498) 评论(0) 推荐(0)
摘要:overide 是覆盖的意思,用在且仅用在虚函数上,虚函数可以是virtual或abstract修饰的,或者是overide修饰的。 文档大概是这么说的。 由此知道,由overide修饰的函数都是虚函数,不需要再使用virtual修饰了(语法上也不允许了),子类也可以使用overide来实现动态绑定 阅读全文
posted @ 2016-11-29 18:34 时空观察者9号 阅读(549) 评论(0) 推荐(0)
摘要:using System; using System.Diagnostics; using System.Text; using System.Collections; using System.Collections.Generic; delegate string DTE(int x, string s); class MYTestX { public class CDT ... 阅读全文
posted @ 2016-11-12 14:42 时空观察者9号 阅读(594) 评论(0) 推荐(0)