Static memory allocation

This is a discussion on Static memory allocation within the C Programming forums, part of the General Programming Boards category; Hi. Is there a tool or even just part of gcc that will tell me the static allocation of a ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    3

    Static memory allocation

    Hi.

    Is there a tool or even just part of gcc that will tell me the static allocation of a given application?

    Thanks

    jim

  2. #2
    Registered User
    Join Date
    Oct 2010
    Location
    Vancouver
    Posts
    5
    This could be achieved by running your program through Valgrind.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    3
    I didnt think Valgrind handled static memory?

  4. #4
    Registered User
    Join Date
    Oct 2010
    Location
    Vancouver
    Posts
    5
    Hrmm, if that's the case you could modify each static allocation to dynamic...that might be a lot of work. Yeah I guess all of your static allocation are allocated on the stack...(doh).

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    3
    Im developing for an embedded platform so static allocation is essential. I thought static memory was all on the heap?

    so i guess i just want to know how much of my heap i am using.

    thanks

    jim

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,544
    size a.out

    Tells you the size of the .text, .data and .bss segments.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory Fragmentation with Dynamic FIFO Queue
    By fguy817817 in forum Linux Programming
    Replies: 17
    Last Post: 10-31-2009, 04:17 AM
  2. A question about memory allocation in Linux
    By BBH in forum C++ Programming
    Replies: 2
    Last Post: 08-25-2009, 06:34 PM
  3. Memory allocation and deallocation
    By Micko in forum C++ Programming
    Replies: 3
    Last Post: 08-19-2005, 06:45 PM
  4. Replies: 1
    Last Post: 03-30-2004, 01:57 PM
  5. static memory and dynamic memory
    By nextus in forum C++ Programming
    Replies: 1
    Last Post: 03-01-2003, 07:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21