Re: how to figure out if an instance was created on the "stack" or on the "heap"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://man7.org/linux/man-pages/man3/end.3.html may be of interest, if
you're running on Linux.
But objects can also be static, and there are alternate stacks, so this
might be more complicated than it sounds.

Why do you need to know?

On Fri, Jul 24, 2020, 13:00 aotto <aotto1968@xxxxxxxxxxx> wrote:

> Hi,
>
> a C++ class can be created on the "stack" or on the "heap"
>
> class A {
>    int test;
> }
>
> // stack
> A myA();
>
> // heap
> A* myA = new A();
>
>
> Question:
>
> it is possible (with gcc) to find out if a instance was created on a
> "stack" or on a "heap" *
>
>
> mfg
>
>
>



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux