| 发表于:2007-03-19 14:33:495楼 得分:5 |
释放一个 s 字符串的内存 [dllimport( "kernel32.dll ", entrypoint = "rtlzeromemory ")] public static extern bool zeromemory(intptr destination, int length); string s ; s = "123123123 "; gchandle gch = gchandle.alloc( s ,gchandletype.pinned ); zeromemory(gch.addrofpinnedobject(), s.length * 2); gch.free(); | | |
|