Memory Leaks with pointers

Discussion in 'VHDL' started by Tricky, Aug 5, 2008.

  1. Tricky

    Tricky Guest

    Consider the following:
    type a_t;
    type a_t_ptr is access a_t;

    type b_t;
    type b_t_ptr is access b_t;

    type a_t is array(integer range <>) of integer;
    type b_t is array(integer range <>) of a_t_ptr;

    begin

    process
    variable P : b_t_ptr;
    begin

    P := new b_t(1 to 10);

    for i in 1 to 10 loop
    p(i) = new a_t(1 to 10);
    end loop;

    DEALLOCATE(P);
    wait;
    end process;

    have I just caused a memory leak by not deallocating all the elements
    in the top level array? would you have to quit the simulator to free
    it again, or just end the simulation?
     
    Tricky, Aug 5, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ASP.Confused

    ASP.NET - Detecting memory leaks

    ASP.Confused, Jul 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,748
    Marina
    Jul 16, 2004
  2. =?Utf-8?B?RnJhbmsxMjEz?=

    Memory Leaks in ASP.NET

    =?Utf-8?B?RnJhbmsxMjEz?=, Mar 4, 2005, in forum: ASP .Net
    Replies:
    12
    Views:
    13,857
  3. James Hunter Ross

    Our memory leaks?

    James Hunter Ross, Oct 20, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    782
    Bruce Barker
    Oct 20, 2005
  4. cerr

    pointers, pointers, pointers...

    cerr, Apr 7, 2011, in forum: C Programming
    Replies:
    12
    Views:
    681
  5. Replies:
    4
    Views:
    127
Loading...

Share This Page