User Profile

Collapse

Profile Sidebar

Collapse
farshid
farshid
Last Activity: Oct 18 '06, 06:25 PM
Joined: Oct 14 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • farshid
    replied to malloc
    in C
    Hi again,

    Yes, some of the functions are using recursion. This is not the only memory allocation and this one uses a constant memory over time, but some other memory allocations vary over time....
    See more | Go to post

    Leave a comment:


  • farshid
    replied to malloc
    in C
    I have tried malloc from stdlib before, eventhough I use the malloc implementation of the software now, but there is no difference when I convert them to malloc of stdlib.

    by the way, I counted the allocation and free calls and they were both equal....
    See more | Go to post

    Leave a comment:


  • farshid
    replied to malloc
    in C
    Thanks for the tips. The program returns a message which I think was generated by the software:

    Allocation of memory failed;...
    See more | Go to post

    Leave a comment:


  • farshid
    replied to malloc
    in C
    oh, I don't know. I am using a c/c++ based software for simulating networks. The software is installed on windows xp, and I do not know how to trace memory leaks....
    See more | Go to post

    Leave a comment:


  • farshid
    replied to malloc
    in C
    here is a copy paste of some part of my code

    int *D;

    void init()
    {
    int sizealloc, sch_size,node_s ize, i;
    sizealloc = (2*nodes+2)*(si zeof(int));
    node_size = nodes*nodes *(sizeof(int));
    D = (int *) malloc(node_siz e);

    ....
    }...
    See more | Go to post

    Leave a comment:


  • farshid
    replied to malloc
    in C
    I use gcc. There was a mistake in that example. actually the line D= (int *) malloc(size); is inside a function called init(). the rest are ok. I don't know why my program eats up the memory. whether or not I free the memory it uses all of it very fast....
    See more | Go to post

    Leave a comment:


  • farshid
    replied to malloc
    in C
    Sorry,
    D= (int *) malloc(size); is in a function called init(). But the pointer declaration "int *D" is not in a fucntion. The program works, but it stops sooner than I need to....
    See more | Go to post

    Leave a comment:


  • farshid
    replied to malloc
    in C
    malloc

    Hello,

    I have written a long program with c, and am using dynamic memory allocation. This program is supposed to be run over and over (300 times) for a long simulation. But the program stops after 120 cycles due to memory leackage. I am not very expert in programing but it seems that my free() function does not do anything to my program. One example of how I do memory allocation and free is this:

    ...
    See more | Go to post

    Leave a comment:


  • farshid
    started a topic malloc
    in C

    malloc

    I have written a long program with c, and am using dynamic memory allocation. This program is supposed to be run over and over (300 times) for a long simulation. But the program stops after 120 cycles due to memory leackage. I am not very expert in programing but it seems that my free() function does not do anything to my program. One example of how I do memory allocation and free is this:

    int *D;
    D= (int *) malloc(size)....
    See more | Go to post
No activity results to display
Show More
Working...