![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Once I saw an implementation of OctreeQuantizer that did not require the Unsafe keyword. Now that I want it I can't find it. Do you know how to find that site? Also do you have a comment about reasons for using the "safe" or the "unsafe" OctreeQuantizer code. What site contains the code you'd recommend? Thanks |
#3
| |||
| |||
|
|
The article has been moved or deleted from MSDN. I wish those guys would learn to keep reference links constant! Here is another article on the same subject: http://msdn2.microsoft.com/en-us/library/aa479306.aspx The reason for using unsafe code in any graphics application is of course speed. Direct access to memory via a pointer is guaranteed to be faster than any other method and optimization of graphics processing is important. -- -- Bob Powell [MVP] Visual C#, System.Drawing Ramuseco Limited .NET consulting http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. "Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message news:OsmuQ07MIHA.5720 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Once I saw an implementation of OctreeQuantizer that did not require the Unsafe keyword. Now that I want it I can't find it. Do you know how to find that site? Also do you have a comment about reasons for using the "safe" or the "unsafe" OctreeQuantizer code. What site contains the code you'd recommend? Thanks |
#4
| |||
| |||
|
|
I got it. What's the down side of unsafe code for a Windows application? Thanks "Bob Powell [MVP]" <bob (AT) spamkillerbobpowell (DOT) net> wrote in message news:77397E75-A709-4E8F-A8FC-E991B38AD858 (AT) microsoft (DOT) com... The article has been moved or deleted from MSDN. I wish those guys would learn to keep reference links constant! Here is another article on the same subject: http://msdn2.microsoft.com/en-us/library/aa479306.aspx The reason for using unsafe code in any graphics application is of course speed. Direct access to memory via a pointer is guaranteed to be faster than any other method and optimization of graphics processing is important. -- -- Bob Powell [MVP] Visual C#, System.Drawing Ramuseco Limited .NET consulting http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. "Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message news:OsmuQ07MIHA.5720 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Once I saw an implementation of OctreeQuantizer that did not require the Unsafe keyword. Now that I want it I can't find it. Do you know how to find that site? Also do you have a comment about reasons for using the "safe" or the "unsafe" OctreeQuantizer code. What site contains the code you'd recommend? Thanks |
#5
| |||
| |||
|
|
In my opinion, the only possible downside to unsafe code is that the requirement to understand the physical layout in memory of an object or data structure is still of paramount importance whereas safe code takes that responsibility away from the programmer and lightens the load. For an old C++ programmer like me it's a useful and fast tool. -- -- Bob Powell [MVP] Visual C#, System.Drawing Ramuseco Limited .NET consulting http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. "Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message news:er$DCBDNIHA.5988 (AT) TK2MSFTNGP02 (DOT) phx.gbl... I got it. What's the down side of unsafe code for a Windows application? Thanks "Bob Powell [MVP]" <bob (AT) spamkillerbobpowell (DOT) net> wrote in message news:77397E75-A709-4E8F-A8FC-E991B38AD858 (AT) microsoft (DOT) com... The article has been moved or deleted from MSDN. I wish those guys would learn to keep reference links constant! Here is another article on the same subject: http://msdn2.microsoft.com/en-us/library/aa479306.aspx The reason for using unsafe code in any graphics application is of course speed. Direct access to memory via a pointer is guaranteed to be faster than any other method and optimization of graphics processing is important. -- -- Bob Powell [MVP] Visual C#, System.Drawing Ramuseco Limited .NET consulting http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. "Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message news:OsmuQ07MIHA.5720 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Once I saw an implementation of OctreeQuantizer that did not require the Unsafe keyword. Now that I want it I can't find it. Do you know how to find that site? Also do you have a comment about reasons for using the "safe" or the "unsafe" OctreeQuantizer code. What site contains the code you'd recommend? Thanks |
#6
| |||
| |||
|
|
The article has been moved or deleted from MSDN. I wish those guys would learn to keep reference links constant! Here is another article on the same subject: http://msdn2.microsoft.com/en-us/library/aa479306.aspx The reason for using unsafe code in any graphics application is of course speed. Direct access to memory via a pointer is guaranteed to be faster than any other method and optimization of graphics processing is important. -- -- Bob Powell [MVP] Visual C#, System.Drawing Ramuseco Limited .NET consulting http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. "Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message news:OsmuQ07MIHA.5720 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Once I saw an implementation of OctreeQuantizer that did not require the Unsafe keyword. Now that I want it I can't find it. Do you know how to find that site? Also do you have a comment about reasons for using the "safe" or the "unsafe" OctreeQuantizer code. What site contains the code you'd recommend? Thanks |
#7
| |||
| |||
|
|
Hi Bob, I guess you know pointers are not always guaranteed to be faster. Bounds checks can be removed by the JIT compiler in some cases, and I was surprised to find some low level rendering code was about equal in speed accessing memory directly using pointers, or using an array of unsigned integers (4 bytes per pixel). Byte arrays are not especially fast using the CLR, but for 4 byte size elements, arrays are about as fast as pointer access. The primary thing to avoid is marshalling data. Regards, Frank Hileman check out VG.net: http://www.vgdotnet.com Animated vector graphics system Integrated Visual Studio graphics editor "Bob Powell [MVP]" <bob (AT) spamkillerbobpowell (DOT) net> wrote in message news:77397E75-A709-4E8F-A8FC-E991B38AD858 (AT) microsoft (DOT) com... The article has been moved or deleted from MSDN. I wish those guys would learn to keep reference links constant! Here is another article on the same subject: http://msdn2.microsoft.com/en-us/library/aa479306.aspx The reason for using unsafe code in any graphics application is of course speed. Direct access to memory via a pointer is guaranteed to be faster than any other method and optimization of graphics processing is important. -- -- Bob Powell [MVP] Visual C#, System.Drawing Ramuseco Limited .NET consulting http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. "Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message news:OsmuQ07MIHA.5720 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Once I saw an implementation of OctreeQuantizer that did not require the Unsafe keyword. Now that I want it I can't find it. Do you know how to find that site? Also do you have a comment about reasons for using the "safe" or the "unsafe" OctreeQuantizer code. What site contains the code you'd recommend? Thanks |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |