|
-
December 9th, 2014, 04:01 AM
#1
How new/delete stores the internal info about the allocated buffer?
I am using C++ new/delete operators to allocate/deallocate the buffers. I think for each allocated buffer, there should be an additional info block stores the size and other info about the buffer. How to know more details about this info block? I need to override these two operators and find such an info block is useful to my implementation.
Thanks
-
December 9th, 2014, 06:41 AM
#2
Re: How new/delete stores the internal info about the allocated buffer?
To find the size of allocated buffers see your other question here http://forums.codeguru.com/showthrea...located-buffer
As far as I am aware other info re allocated memory is not available.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
December 9th, 2014, 07:57 AM
#3
Re: How new/delete stores the internal info about the allocated buffer?
"there is no portable way to do so".
going into specific compilers there are ways by which you can get free store information or even go lower level and get OS heap management information.
none of those will typically work when custom allocators or overloaded operator new are in play.
-
December 9th, 2014, 07:58 AM
#4
Re: How new/delete stores the internal info about the allocated buffer?
Or alternatively, that may actually be the way you do get at it.
install your own global new/delete operators and do any sort of allocation tracking you want from there.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|