Write comments

Memory management problem

23. Apr 2017, 19:15

Got to the HTTP server
In InternetProtocolProvider::Send when malloc is called it goes into an infinite loop in
for(MemoryChunk* chunk = first; chunk != 0 && result == 0; chunk = chunk->next)
Did it happend to anyone.

23. Apr 2017, 19:15

Re: Memory management problem

24. Apr 2017, 21:17

I hate it when I get some bug search for it, dont find it, post it here and little bit after that I find the mistake.
I have put
result -> next = temp;
result -> prev = temp;
instead of just
result -> next = temp;

Re: Memory management problem

26. Apr 2017, 12:11

But temp is the new chunk behind the result chunk - why should result -> prev point to it? result->prev stays the same as before

maybe it wasn't set in the previous call? Do you set temp->prev = result? Do you initialize it for the first chunk in the MemoryManager constructor?
actually the pointer is never used except when freeing, so maybe the problem is in the free(...) method?

Re: Memory management problem

26. Apr 2017, 19:01

No. I set prev to temp on accident and it is what made problem. I overwrote what was there before.
Write comments




Bei iphpbb3.com bekommen Sie ein kostenloses Forum mit vielen tollen Extras
Forum kostenlos einrichten - Hot Topics - Tags
Beliebteste Themen: NES, Mode, Linux, Rap, Programm

Impressum | Datenschutz