Skip to main content
gamedev.net
🔒 Locked

checking the current memory?

Started by GenmaC 5 replies 350+ views
Original Post
GenmaC
GenmaC
I''m doing a lot of pointer crap, and so for debugging purposes, I need to check the current stack as well as the heap status. What happened to _stackavail and coreleft(), or what are their Microsoft Visual C++ 6.0 equivalents? Thanks.
IndirectX
IndirectX
I suppose you can use VirtualQuery to emulate _stackavail. I''ve never heard of coreleft. You can check out some stuff I posted here.
---visit #directxdev on afternet <- not just for directx, despite the name
GenmaC
GenmaC
coreleft() was a heap monitoring function in Borland C++ 3.1.

Which is what I need...the size of the heap - that way, after a complex manipulation, I can make sure I haven''t left anything laying around, so to speak...

_stackavail isn''t really vital, but I''m at a complete loss as to why newer versions of C++ have no heap size functions...
IndirectX
IndirectX
You can use CRT debug heap: _CrtDumpAllObjectsSince and the such.
---visit #directxdev on afternet <- not just for directx, despite the name
DerekSaw
DerekSaw
quote:
Original post by GenmaC
... but I''m at a complete loss as to why newer versions of C++ have no heap size functions...


Not that the ''newer versions'' of C++ don''t have heap size functions, Borland and Microsoft just have their own games and ''board sizes''... with some extra digging u could find it.

(IMHO) btw, coreleft() (and farcoreleft(), etc. ) is very useful for me in those (16bit DOS) days... I really hope for one in MSVC.
"after many years of singularity, i'm still searching n the event horizon" o
IndirectX
IndirectX
quote:
Original post by DerekSaw
I really hope for one in MSVC.

MSVC provides much more debugging capabilities than just a couple of functions to return available heap memory, so I fail to see why you want those particular functions when better facilities are available.
---visit #directxdev on afternet <- not just for directx, despite the name
DerekSaw
DerekSaw
quote:
Original post by IndirectX
...than just a couple of functions to return available heap memory...



That''s JUST what I need.


quote:

...so I fail to see why you want those particular functions when better facilities are available.


Just personal preferences. I would rather drive a car than piloting a full-of-features jetfighter just to buy a shampoo. coreleft() is way too simple to use, and ''more english'' .
"after many years of singularity, i'm still searching n the event horizon" o

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.