<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 - Discussions by PhrostByte</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 - Discussions by PhrostByte</title>
		<link>http://channel9.msdn.com/Niners/PhrostByte/Discussions</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Niners/PhrostByte/Discussions</link>
	<language>en</language>
	<pubDate>Fri, 24 May 2013 08:24:25 GMT</pubDate>
	<lastBuildDate>Fri, 24 May 2013 08:24:25 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>0</c9:totalResults>
	<c9:pageCount>0</c9:pageCount>
	<c9:pageSize>0</c9:pageSize>
	<item>
		<title>Tech Off - C# 3.0: What I Want</title>
		<description><![CDATA[<p>The point was to *not* do these checks, but have .NET check and throw the exception for you.&nbsp; C# and .NET are geared toward quickly producing quality code and this could only help that - while I (grudgingly) check all my public methods I'm sure there are
 a lot of coders out there who just assume things will never be null.<br>
<br>
Chances are you don't need a custom message, and if you do, don't mark it non-nullable and do the checks yourself.&nbsp; It's a win-win idea.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/92949-C-30-What-I-Want/01103b34078b4eaa8f109dea01273e3a#01103b34078b4eaa8f109dea01273e3a</link>
		<pubDate>Mon, 01 Aug 2005 08:40:15 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/92949-C-30-What-I-Want/01103b34078b4eaa8f109dea01273e3a#01103b34078b4eaa8f109dea01273e3a</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - C# 3.0: What I Want</title>
		<description><![CDATA[<p>One thing I really wished was in C# 2.0 way to specify a method argument as &quot;non-nullable&quot;.&nbsp; Not having to manually check arguments for null would be a big plus in reducing and simplifying code.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/92949-C-30-What-I-Want/92949#92949</link>
		<pubDate>Mon, 01 Aug 2005 01:55:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/92949-C-30-What-I-Want/92949#92949</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Who should learn unmanaged code?</title>
		<description><![CDATA[<p>Learn C&#43;&#43;.&nbsp; It takes a while to get there but once you start using a lot of the STL and templating you'll begin to miss it in C#.&nbsp; That said, C# is also an excellent language to learn.&nbsp; They just serve different areas.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/62690-Who-should-learn-unmanaged-code/80ec86186f834744a1789dea011e7adf#80ec86186f834744a1789dea011e7adf</link>
		<pubDate>Mon, 02 May 2005 19:28:24 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/62690-Who-should-learn-unmanaged-code/80ec86186f834744a1789dea011e7adf#80ec86186f834744a1789dea011e7adf</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>28</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Best line of code ever</title>
		<description><![CDATA[<p>I've seen people&nbsp;do a good deal of weird stuff, two of my favorites:<br>
<br>
int i; i^=i; // optimization, makes i = 0, but faster.<br>
<br>
char str[32];<br>
strcpy(str, &quot;foo&quot;);<br>
strcat(str, &quot;\0&quot;); // set null terminator<br>
</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/29732-Best-line-of-code-ever/1efd354aef934544a68e9dea01165adc#1efd354aef934544a68e9dea01165adc</link>
		<pubDate>Thu, 02 Dec 2004 19:01:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/29732-Best-line-of-code-ever/1efd354aef934544a68e9dea01165adc#1efd354aef934544a68e9dea01165adc</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Should I make namespace std global?</title>
		<description><![CDATA[<p>I usually do a &quot;using namespace std&quot; in source files (unless they are really small)&nbsp;and std::* in header files.&nbsp; It doesn't compile anything extra, just makes your life easier.&nbsp; The only way it can be bad is if you have custom classes with the same names
 as the STL classes, in which case you will have to fully use std::* to declare one.<br>
</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/26983-Should-I-make-namespace-std-global/b018f05ba297484f88c29dea0115f91e#b018f05ba297484f88c29dea0115f91e</link>
		<pubDate>Fri, 05 Nov 2004 12:05:16 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/26983-Should-I-make-namespace-std-global/b018f05ba297484f88c29dea0115f91e#b018f05ba297484f88c29dea0115f91e</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>3</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - .NET Gurus: Pinning a delegate for P/Invoke</title>
		<description><![CDATA[<p>Declare your function pointer as typedef void (*FuncPtr)(int i);<br>
<br>
<br>
<blockquote>
<div>Rossj wrote:</div>
<div>
<blockquote>
<table>
<tbody>
<tr>
<td><img src="/Themes/redesign/images/icon-quote.gif"></td>
<td><strong>PhrostByte wrote:</strong> <i>Probably not, but the exception is still being thrown <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-6.gif' alt='Sad' />&nbsp; Anyone have a solution?</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br>
<br>
I wrote a simple bit of code to replicate this and it works, or rather I can replicate either of the two problems you mentioned.&nbsp; Without the GCHandle a NPE is thrown in the dllimport'ed function that calls the delegate from C (after it has actually done the
 callback), and with the handle I get ArgumentException thrown about non-blittable types.<br>
<br>
Please forgive the ugly code ..<br>
<br>
<blockquote>
<table>
<tbody>
<tr>
<td><img src="/Themes/redesign/images/icon-quote.gif"></td>
<td><strong>C code wrote:</strong> <i><br>
#include &lt;windows.h&gt;<br>
<br>
typedef void FuncPtr( int i );<br>
<br>
FuncPtr *cb;<br>
<br>
__declspec( dllexport )<br>
void SetCallback( FuncPtr ptr )<br>
{<br>
&nbsp;&nbsp;&nbsp; cb = &amp;ptr;<br>
}<br>
<br>
__declspec( dllexport )<br>
void SomeFunc()<br>
{<br>
&nbsp;&nbsp;&nbsp; if ( *cb ) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *cb( 10 );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br>
<br>
<blockquote>
<table>
<tbody>
<tr>
<td><img src="/Themes/redesign/images/icon-quote.gif"></td>
<td><strong>C# wrote:</strong> <i><br>
&nbsp;&nbsp;&nbsp; class Class1<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public delegate void MyDelegate( int i );<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MyDelegate deleg;<br>
//&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GCHandle handle;<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public Class1()<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; deleg = new MyDelegate( SomeCallback );<br>
<br>
//&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; handle = GCHandle.Alloc( deleg, GCHandleType.Pinned );<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SetCallback( deleg );<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Calls into native code to fire the callback<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void WorkerMethod()<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SomeFunc();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void Close()<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
//&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; handle.Free();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [DllImport(&quot;nativecode.dll&quot;)]<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public static extern void SetCallback( MyDelegate d );<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [DllImport(&quot;nativecode.dll&quot;)]<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public static extern void SomeFunc();<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public static void SomeCallback( int i )<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Console.WriteLine( &quot;Callback &quot; &#43; i.ToString() );<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [STAThread]<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; static void Main(string[] args)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Class1 c = new Class1();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; c.WorkerMethod();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; c.Close();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br>
</div>
</blockquote></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/6e0f552f45a24f9c87389dea0115f787#6e0f552f45a24f9c87389dea0115f787</link>
		<pubDate>Fri, 05 Nov 2004 09:41:28 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/6e0f552f45a24f9c87389dea0115f787#6e0f552f45a24f9c87389dea0115f787</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - .NET Gurus: Pinning a delegate for P/Invoke</title>
		<description><![CDATA[<p>Probably not, but the exception is still being thrown <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-6.gif' alt='Sad' />&nbsp; Anyone have a solution?<br>
<br>
<blockquote>
<div>Rossj wrote:</div>
<div>
<blockquote>
<table>
<tbody>
<tr>
<td><img src="/Themes/redesign/images/icon-quote.gif"></td>
<td><strong>PhrostByte wrote:</strong> <i>Am I not able to use marshaling in a delegate?&nbsp; It compiles fine.<br>
<br>
<p>delegate int ReportFilter(IntPtr doc, int lvl, uint line, uint col, [MarshalAs(UnmanagedType.LPStr)] string msg);<br>
<br>
edit: still doesn't work when declaring msg as an IntPtr.</p>
</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br>
<br>
I am not sure that the MarshalAs is necessary. I'm just on my way home, if no-one else answers before then I'll look it up later.<br>
</div>
</blockquote></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/e411de1633024f08b0e99dea0115f71d#e411de1633024f08b0e99dea0115f71d</link>
		<pubDate>Thu, 04 Nov 2004 23:06:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/e411de1633024f08b0e99dea0115f71d#e411de1633024f08b0e99dea0115f71d</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - .NET Gurus: Pinning a delegate for P/Invoke</title>
		<description><![CDATA[<p>Am I not able to use marshaling in a delegate?&nbsp; It compiles fine.<br>
<br>
<p>delegate int ReportFilter(IntPtr doc, int lvl, uint line, uint col, [MarshalAs(UnmanagedType.LPStr)] string msg);<br>
<br>
edit: still doesn't work when declaring msg as an IntPtr.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/67baa32ce4d4419681669dea0115f6c9#67baa32ce4d4419681669dea0115f6c9</link>
		<pubDate>Thu, 04 Nov 2004 16:20:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/67baa32ce4d4419681669dea0115f6c9#67baa32ce4d4419681669dea0115f6c9</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - .NET Gurus: Pinning a delegate for P/Invoke</title>
		<description><![CDATA[<p>Tried that, GCHandle.Alloc() throws an exception about non-blittable memory.<br>
<br>
<blockquote>
<div>Rossj wrote:</div>
<div>
<blockquote>
<table>
<tbody>
<tr>
<td><img src="/Themes/redesign/images/icon-quote.gif"></td>
<td><strong>PhrostByte wrote:</strong> <i><br>
in memory.</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br>
<br>
GCHandle.Alloc( myDelegate, GCHandleType.Pinned ) ? <br>
<br>
As in<br>
<br>
GCHandle handle = GCHandle.Allow( d, GCHandleType.Pinned );<br>
setdelegate(d); // p/invoked,&nbsp;stores the function pointer<br>
somefunc() // p/invoked, can call&nbsp;function pointer.<br>
handle.Free();<br>
<br>
Edit: Free is not static, and should only be called once.<br>
</div>
</blockquote></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/34ab85c261d44abeb0429dea0115f64c#34ab85c261d44abeb0429dea0115f64c</link>
		<pubDate>Thu, 04 Nov 2004 15:53:28 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/34ab85c261d44abeb0429dea0115f64c#34ab85c261d44abeb0429dea0115f64c</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - .NET Gurus: Pinning a delegate for P/Invoke</title>
		<description><![CDATA[<p><blockquote>
<div>Rossj wrote:</div>
<div>
<blockquote>
<table>
<tbody>
<tr>
<td><img src="/Themes/redesign/images/icon-quote.gif"></td>
<td><strong>PhrostByte wrote:</strong> <i>That is good advice if you are passing a delegate through one function.&nbsp; In my case the library is storing it.<br>
I am doing:<br>
setdelegate(d); // p/invoked,&nbsp;stores the function pointer<br>
somefunc() // p/invoked, can call&nbsp;function pointer.<br>
the delegate can be moved before or during somefunc()'s execution.</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br>
<br>
Do you mean moved (in memory) or changed (to point to a different method) ?<br>
</div>
</blockquote>
<br>
<br>
in memory.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/36b4d9bc0174413c925a9dea0115f5f9#36b4d9bc0174413c925a9dea0115f5f9</link>
		<pubDate>Thu, 04 Nov 2004 15:33:48 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/36b4d9bc0174413c925a9dea0115f5f9#36b4d9bc0174413c925a9dea0115f5f9</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - .NET Gurus: Pinning a delegate for P/Invoke</title>
		<description><![CDATA[<p>That is good advice if you are passing a delegate through one function.&nbsp; In my case the library is storing it.<br>
<br>
I am doing:<br>
<br>
setdelegate(d); // p/invoked,&nbsp;stores the function pointer<br>
<br>
somefunc() // p/invoked, can call&nbsp;function pointer.<br>
<br>
the delegate can be moved before or during somefunc()'s execution.<br>
<br>
<br>
<br>
<br>
<blockquote>
<div>Rossj wrote:</div>
<div>You could use <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemruntimeinteropservicesgchandleclasstopic.asp" target="_blank">
GCHandle </a>but possibly different info from Chris Brumme <a href="http://blogs.msdn.com/cbrumme/archive/2003/05/06/51385.aspx" target="_blank">
here</a><br>
<br>
<blockquote>
<table>
<tbody>
<tr>
<td><img src="/Themes/redesign/images/icon-quote.gif"></td>
<td><strong>Chris Brumme wrote:</strong> <i><br>
<p>Finally, a word on pinning.&nbsp; I often see applications that aggressively pin managed objects or managed delegates that have been passed to unmanaged code.&nbsp; In many cases, the explicit pin is unnecessary.&nbsp; It arises because the developer has confused the requirement
 of tracking an object instance via a handle with the requirement of keeping the bytes of that object at a fixed location in memory.</p>
<p>&nbsp;</p>
<p>...The PInvoke layer is hooked into the CLR’s stack crawling mechanism for GC reporting.&nbsp; So it can defer all overhead related to pinning unless a GC actually occurs while the PInvoke call is in progress.&nbsp; Applications that explicitly pin buffers around
 PInvoke calls are <i>often</i> doing so unnecessarily.</p>
</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br>
</div>
</blockquote></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/5b9acbe238cc49ce9c729dea0115f5a5#5b9acbe238cc49ce9c729dea0115f5a5</link>
		<pubDate>Thu, 04 Nov 2004 15:17:17 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/5b9acbe238cc49ce9c729dea0115f5a5#5b9acbe238cc49ce9c729dea0115f5a5</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - .NET Gurus: Pinning a delegate for P/Invoke</title>
		<description><![CDATA[<p>I'm attempting to P/Invoke a C library.&nbsp; It requires me to pass a delegate which the library will store for later use.<br>
<br>
Because I do not use this delegate later in managed code it gets collected.&nbsp; Easy enough to stop, but pinning it in one memory location is another story.&nbsp; Is this possible?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/26851#26851</link>
		<pubDate>Thu, 04 Nov 2004 14:49:57 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/26851-NET-Gurus-Pinning-a-delegate-for-PInvoke/26851#26851</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - PHP 5 V ASP.Net (2)</title>
		<description><![CDATA[<p>I use PHP for small one page hacks (which iirc is what PHP was made for).&nbsp; ASP.NET is much more organized, faster, and has a ton of backing.&nbsp; I refuse to use PHP for large projects.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/13331-PHP-5-V-ASPNet-2/5c87876545f94df081a09dea011212e5#5c87876545f94df081a09dea011212e5</link>
		<pubDate>Sun, 25 Jul 2004 05:46:30 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/13331-PHP-5-V-ASPNet-2/5c87876545f94df081a09dea011212e5#5c87876545f94df081a09dea011212e5</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Jumping out of a heavily-nested loop not by using goto statement?</title>
		<description><![CDATA[<p>Goto is only evil if used incorrectly.&nbsp; I have no problem using it to break out of a nested loop.&nbsp; Actually it's the only place I would use it..</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/14014-Jumping-out-of-a-heavily-nested-loop-not-by-using-goto-statement/ab4fe14fe1db4def8a209dea01127396#ab4fe14fe1db4def8a209dea01127396</link>
		<pubDate>Sun, 25 Jul 2004 05:40:41 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/14014-Jumping-out-of-a-heavily-nested-loop-not-by-using-goto-statement/ab4fe14fe1db4def8a209dea01127396#ab4fe14fe1db4def8a209dea01127396</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>59</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Memory manager problem?</title>
		<description><![CDATA[<p>I'm sorry but regardless of how often or not a function is used, realloc() going over 600 times slower on Windows *is* horribly wrong.&nbsp; There is no excuse for slow code.<br>
<br>
Thanks for the link though, I'll try that on the heap code.<br>
<br>
edit: didn't mean to come off as hostile there.&nbsp; inefficiency in code is a pet peeve - I bug friends about things they write if they could be even 5% faster <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-5.gif' alt='Wink' /><br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/12813-Memory-manager-problem/548c1e04571c403bbc899dea0111f2e2#548c1e04571c403bbc899dea0111f2e2</link>
		<pubDate>Wed, 14 Jul 2004 15:19:55 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/12813-Memory-manager-problem/548c1e04571c403bbc899dea0111f2e2#548c1e04571c403bbc899dea0111f2e2</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Memory manager problem?</title>
		<description><![CDATA[<p>Case #1:<br>
That sample prog I gave did nothing but call realloc in a loop 640 times, so it is definately in realloc.&nbsp; Havn't changed any memory settings, and it is on the same PC with nothing unneeded running in the background.&nbsp; The times are from the program, and I don't
 need it to be any more accurate as there is a massive noticable difference.&nbsp; I also compiled the same source with GCC in Windows (ala MinGW) and it ran even slower.<br>
<br>
Case #2:<br>
libxml2.&nbsp; This stemmed out of a recent convo in their mailing list where dumping large xml documents would take *much* longer on windows.&nbsp; After some investigation we found it was growing a buffer by 16KiB up to 10MiB.&nbsp; As soon as it was made to double the
 current size instead of increasing it by a 16KiB the speed skyrocketed to be the same as it was on Linux.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/12813-Memory-manager-problem/1b1585276c4f4802b1fc9dea0111f30d#1b1585276c4f4802b1fc9dea0111f30d</link>
		<pubDate>Wed, 14 Jul 2004 15:10:45 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/12813-Memory-manager-problem/1b1585276c4f4802b1fc9dea0111f30d#1b1585276c4f4802b1fc9dea0111f30d</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Memory manager problem?</title>
		<description><![CDATA[<p>good point.<br>
<br>
under windows: it's compiled with full optimizations in non-managed mode using vs.net 2003.&nbsp; it happens with vs6 also.<br>
<br>
under debian linux: gcc 3.4, full optimizations.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/12813-Memory-manager-problem/d884341ca0114657b5249dea0111f261#d884341ca0114657b5249dea0111f261</link>
		<pubDate>Tue, 13 Jul 2004 18:11:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/12813-Memory-manager-problem/d884341ca0114657b5249dea0111f261#d884341ca0114657b5249dea0111f261</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Memory manager problem?</title>
		<description><![CDATA[<p>Hey guys,&nbsp; there seems to be something horribly wrong with the Windows memory manager.<br>
<br>
See this source: <a href="http://dev.int64.org/memory.c">http&#58;&#47;&#47;dev.int64.org&#47;memory.c</a><br>
It runs in 8sec on winxp, and 0.013sec in linux.&nbsp; Even with my 1.5GiB of ram I thought maybe it wasn't able to expand the memory each time but I made it use a fixed 10MiB heap it and performs just as bad.&nbsp; Any gurus care to comment?<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/12813-Memory-manager-problem/12813#12813</link>
		<pubDate>Tue, 13 Jul 2004 16:07:18 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/12813-Memory-manager-problem/12813#12813</guid>
		<dc:creator>Cory Nelson</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PhrostByte/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>