[Autogenerated] fortunately the visual C++ runtime source
code is provided with Visual studio so we can see where
functions such as Malek and happen.
So let's start by creating a simple allocation here just calling the
function Malek with whatever number and put a breakpoint here.
See if we can figure out where Malek is headed.
If I press F five here to compile and run this and now press F 11 to step
into the function Malek we can see that it fails so essentially Malek is
happening in the single ______ and that is that and that's because
Visual Studio sees that Malek is not part of my code so it assumes that
I'm not really interested in seeing what's going on inside Malek and
indeed in most cases I'm not unless I am which in this case this is what
we want in order to do that we have to tell Visual Studio to remove that,
check that it's doing,
I'm going to go to debug and options which is the same as going to tools,
options and lending in the debugging general tab and there you
can see this option called enable just my code.
That's exactly the option that tells Visual Studio to disregard
source code which is not part of my source repository.
So I'm going to disable that option to uncheck it and press
OK now if I go ahead and press F 11 will get into Malek
here's the Malek function shown here,
you can see the Malek function shown with the size now by default,
you will not end up in this source.
Exactly.
In fact you'll get an open file dialog box will have to figure out where the
mala dot CPP file is where the implementation is already done that and
located that and here's where it is on my machine.
And it should be on your machine in essentially the same
directory except for the build number or the version of the
SDK which might be slightly newer.
So you can try whatever newer is on your machine,
whatever its newest on your machine.
And so once we get there we can start debugging normally.
So here we consider two malek actually malek implementations,
one of them is a debug version.
The other one is a release version here.
We're using the debug version.
Since while we have compiled in debug build in debug mode.
So I'm going to press F11 to continue diving deeper.
And then at some point we'll get to the this particular
code here saying hip a lot DBG internal.
So let's go into that are pressing another F11 and
then there's some locking here, some validation.
You can see there's lots of debugging stuff that is happening here.
The C R T tracks various stuff when you're working with the bug bill to
make it easier to figure out what's going on or what went wrong if you
get some _____ failures or hip corruptions.
But at some point that should be, there should be a call somewhere to hip lock.
So let's see that's not the one about this one.
Not yet.
Let's continue even more and finally we get here to the hip I'll coal.
Notice it's the hip I'll cole uses the block size which contains
some header and the actual bites are requested.
So the block size is going to be a bit bigger than 100.
Let's go to decimal here.
You can see the block size 152 bites.
Not just 100.
You might be thinking this is a big overhead indeed this is the
case for debug builds or the bug executions but for at least the
overhead is much much smaller and you can see here that we have the
a CRT heap which is supposed to be the handle to the hip that is
actually being used.
So can we actually say that this is the default process.
Hip,
there's no way to tell just yet but we'll be able to compare that a bit later.
We'll try this out as well anyway,
you can see the hip I'll is in fact the one that's being used here And
from that point on we can see that we have a header on our hands with
the data itself and there's some other stuff here that's going to
happen to initialize the header correctly compressed F shift F 11 to
step out of this function.
Step out of this one and eventually going to go back to my ma local here.
So what about the different process.
hip.
Well, we can run the program again display Get process Hip.
We can try that using the immediate window.
Maybe we'll get lucky.
So let's call the get process hip.
And use the question mark here to execute and display the result of that.
Well, unfortunately this doesn't work.
Okay, fine.
Let's just shift at five and then call get also sleep here just
to make sure that we're using default people.
Maybe not.
Maybe the implementation has somehow changed.
So you can see the the default hip here.
Let me just display that at this point.
You can see the number right here and then we need to look at that
particular variable which is currently not in scope.
So let's just go deeper into that.
And you can see once we get into the Malek implementation that
verbal is already in scope and we can see that.
Indeed they have exactly the same value which proves that
Malek is using the default process Hip.
So this implementation might change in the future,
but this is how it is implemented in this version of us through 2022 and
has been around for for a while for at least some years