Is Sunday, is raining, my wife is reading some psychological shit and I’m bored. I knew from the morning I need to do something very very important today, so I start to count the “fuck” word in Linux Kernel.
This command is faster
find . -name *.[hcS] -not -regex ‘\./\.git.*’ | xargs cat | grep ” fuck” | wc -l
than this command:
egrep -ir “( fuck)” * | wc -l
Memcpy is the fastest way to copy one chunk of memory to another. But right now Microsoft is banning memcpy function from their products. memcpy over the years was responsable for a lot of security problems in Microsoft products, but the main problem of this function was the programmer. The approach of this function was to provide us a very fast way to copy a chunk of memory to another and it succeed over the years, but passing bad variables to it is the programmer fault not the function itself.
I was just curious how many times memcpy appears in linux kernel source (184.108.40.206) code and I just run following command to find out
find . -name *.[hcS] -not -regex ‘\./\.git.*’ | xargs cat | grep memcpy | wc -l
And the result was
A lot of possible bugs … then why Linus doesn’t ban this function from the Linux kernel?
Beside that Microsoft also ban : RtlCopyMemory, CopyMemory.
Now developers who want to be SDL compliant will should replace memcpy() functions with memcpy_s, that takes an additional parameter defining the size of the destination buffer. But my Question is: what if happens if all parametres are wrong ? You can only check the consistency of 2 arguments … and memcpy_s it seems is 3 times slower.
In the article from msdn site posted by sdl we have some hints how to write our code SDL compliant.
#pragma deprecated (memcpy, RtlCopyMemory, CopyMemory)
in your header files and at compile time you should see something like
warning C4995: ‘memcpy’: name was marked as #pragma deprecated
Also you can ban this on GCC compilers in this way:
#pragma GCC poison memcpy RtlCopyMemory CopyMemory
Happy Coding !
Latest updated is recommended for Mac OS X 10.5 Leopard and includes general operating system fixes that enhance the stability, compatibility and security of your Mac and also is coming with new features.
The most notable features and fixes are:
* Latest security fixes.
* Additional RAW image support for several third-party cameras.
* Improves the reliability and accuracy of Unit Converter, Stocks, Weather and Movies Dashboard widgets.
* Addresses a situation that may cause issues when logging into Gmail.
* Improves performance of video playback and cursor movements for recent Macs with NVIDIA graphics.
* Fix an issue with Dvorak keyboard layout in Mac OS X 10.5.6.
* Improves reliability when syncing contacts with Yahoo!.
* Improves stability for network home directories hosted by Mac OS X Server v10.4.
* Improves Finder search results for network volumes that may not support Spotlight searching, such as Mac OS X Server v10.4, Time Capsule, and third-party AFP servers.
* Several improvements to Directory Service and Client Management.
* Expansion Slot Utility for Mac Pro now reports the correct PCIe slot configuration.
* Improves network performance when connected to certain Ethernet switches that have Flow Control enabled.
* Fix an issue in which time limits may not work properly with full-screen games and Fast User Switching.
* Improves consistency with Parental Controls and application restrictions.
* Includes other printing reliability and stability improvements.
This is the truth !