Showing results for September 2006 - Page 4 of 4 - The Old New Thing

Sep 7, 2006
0
0

You have to free memory with the same allocator that allocated it: Logical consequences

Raymond Chen
Raymond Chen

Everybody should know by now that you have to free memory using the same allocator that you used to allocate the memory. If you allocate with then you have to free with ; if you allocate with then you have to free with . Once you've internalized this rule, you can use it to draw other logical conclusions. Consider: When I call the function, wh...

Code
Sep 6, 2006
0
0

In case of fire, go to lunch

Raymond Chen
Raymond Chen

Late one morning, the fire alarm went off at work. Everybody dutifully filed out of the building and waited for the all-clear signal. A few of us looked at each other and said, "Let's go to lunch." "I'll drive." "Shotgun!"

Non-Computer
Sep 6, 2006
0
0

You already know what your target architecture is (or at least you should)

Raymond Chen
Raymond Chen

Sometimes the questions I see make me shake my head in wonderment. How do I determine programmatically what processor architecture my program was compiled for? I want the x86 version of my program to behave differently from the ia64 version. Is there some API I can call? Note that this person isn't asking whether the program is running on 64-...

Code
Sep 5, 2006
0
0

Just change that 15 to a 1

Raymond Chen
Raymond Chen

It would be nice and easy to just change that 15 to a 1. If only it were that simple. In the case described in that article, it's not that a single operation was attempted fifteen times in a loop. Rather, the fifteen operations were scattered all over the program. Suppose, for example, that the network operation was "Get the attributes of thi...

Other
Sep 4, 2006
0
0

I think I've just broken the internet

Raymond Chen
Raymond Chen

On our internal blogging discussion mailing list, John Kennedy explained that he was trying to set up a video blog but somehow he ended up including the entire video into his RSS feed. He managed to fix the problem, but apologized: If the internet is broken, it was my fault. That was funny enough, but Keith Combs chimed in with some technical ...

Other
Sep 1, 2006
0
0

You're white. Do you want to be in my friend's soap opera?

Raymond Chen
Raymond Chen

What does a Mandarin-speaking American woman in Beijing do? If you're Rachel DeWoskin, you serendipitously wind up the star of a daytime Mandarin-language soap opera called Foreign Babes in Beijing, a show that takes all the Western stereotypes (from the Chinese point of view) and milks them for all their melodramatic worth. (They probably watche...

Non-Computer
Sep 1, 2006
0
0

On the unanswerability of the maximum number of user interface objects a program can create

Raymond Chen
Raymond Chen

The answer to the question "What is the maximum number of window classes a program can register?" is not a number. Most user interface objects come from a shared pool of memory known as the "desktop heap". Although one could come up with a theoretical maximum number of window classes that can fit in the desktop heap, that number is not achievable ...

Code