Bug Reports: Memory Leak in VC++ PPL and ASAN support in MFC

Today, I just filed 2 bug reports on Visual C++: Memory Leaks in VC++ PPL’s parallel_for_each() reported by Deleaker and MFC support in Address Sanitizer. The latter is having linkage issue of duplicate symbols of new/delete operators that exists in both MFC and Clang ASAN. I need your help to upvote these 2 bug reportsContinue reading “Bug Reports: Memory Leak in VC++ PPL and ASAN support in MFC”

Direct2D Tutorial Part 1: RenderTarget

Introduction Direct2D is introduced to phase out the dated GDI+ in 2009 and is supported on Windows 7 or newer. This is the first in an introductory Direct2D tutorial series. In this tutorial, we are going to take a look at various different RenderTarget. Think RenderTarget as a canvas to draw on. We focus onContinue reading “Direct2D Tutorial Part 1: RenderTarget”

C/C++: Allocate Variable-size Arrays on the Stack

C language provides the alloca function to allocate arbitrary size array on the stack. After the function returns or the scope ends, the stack memory is automatically reclaimed back(popped back) without the developer having to deallocate it explicitly and thereafter is unsafe to access it again from another function. The below code shows allocating fixedContinue reading “C/C++: Allocate Variable-size Arrays on the Stack”

Address Sanitizer in Visual C++

In this blog, I’ll demonstrate on how to utilize Address Sanitizer (ASan) in Visual C++ to check for memory problems. MSVC team ported the Clang ASan to the Windows platform in 2019 and since it is still at the experimental stage, be sure to expect kinks to be ironed out. Before using Address Sanitizer inContinue reading “Address Sanitizer in Visual C++”

C++23: Mutable string_view

In the upcoming C++23, the mutable string_view proposal is under review for inclusion in the next Standard Library. As we all know the current immutable string_view has two members, a const pointer to a constant char array and a constant length whereas in the mutable sibling, both members are modifiable. Let me illustrate with aContinue reading “C++23: Mutable string_view”

Deleaker Review

What keeps a C++ developer awake at night? A nagging question at the back of his subconsciousness is “Does my application have a memory leak?”. Continual memory leaks can be detrimental to long-running programs and eventually, the system runs out of memory and is stopped in its operation. Detection and elimination of memory leak shouldContinue reading “Deleaker Review”

Visual C++ 6.0 Developer’s Reference

Came across this picture of Visual C++ 6.0 Developer’s Reference(1998) posted by raddevus. I had a C++ Master Reference published in 1999. It has 1500 pages of C++ language and library reference! I had perhaps only read one page(about atoi()). It is like a predecessor of Cppreference except it is printed on book and isContinue reading “Visual C++ 6.0 Developer’s Reference”

Running VC++ Executable on User Machine Without its DLLs

Since this question is asked on CodeProject today, I’ll answer it here. To deploy without having to install the Visual C++ DLLs, the program has to be linked statically. Linking to C runtime statically: Right-click on your project in the Solution Explorer and select Properties and go to C/C++ -> Code Generation. Select Multithreaded (/MT)Continue reading “Running VC++ Executable on User Machine Without its DLLs”

Floating-Point Article Win January Prize

My floating-point article won the best article prize for the articles posted in month of January 2020. The prize is a priceless CodeProject mug(above picture) which is just delivered to my house. The impetus to writing this article started with a rule enshrined in the company wiki that “all multiplications must be converted to divisionsContinue reading “Floating-Point Article Win January Prize”