Click here to Skip to main content
15,907,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Memory leak in producer-consumer program Pin
Richard Andrew x6425-Feb-13 10:08
professionalRichard Andrew x6425-Feb-13 10:08 
GeneralRe: Memory leak in producer-consumer program Pin
noislude25-Feb-13 10:23
noislude25-Feb-13 10:23 
GeneralRe: Memory leak in producer-consumer program Pin
Richard Andrew x6425-Feb-13 10:33
professionalRichard Andrew x6425-Feb-13 10:33 
GeneralRe: Memory leak in producer-consumer program Pin
noislude25-Feb-13 10:42
noislude25-Feb-13 10:42 
QuestionRe: Memory leak in producer-consumer program Pin
David Crow25-Feb-13 13:28
David Crow25-Feb-13 13:28 
AnswerRe: Memory leak in producer-consumer program Pin
noislude25-Feb-13 13:33
noislude25-Feb-13 13:33 
GeneralRe: Memory leak in producer-consumer program Pin
Stefan_Lang26-Feb-13 3:29
Stefan_Lang26-Feb-13 3:29 
GeneralRe: Memory leak in producer-consumer program Pin
noislude26-Feb-13 8:07
noislude26-Feb-13 8:07 
I fixed the problem with the buffer index. Now I can notice three behaviors:

the first one, always producing one stuff and consuming it (in this case, I get a memory leak)

VB
Produce: 1
Consume: 1
Produce: 1
Consume: 1
Produce: 1
Consume: 1
Produce: 1
Consume: 1
Produce: 1
Consume: 1
Produce: 1
Consume: 1
Produce: 1
Consume: 1
Produce: 1
Consume: 1


possibly lost: 272 bytes in 1 blocks


for the second behavior, I produced and consumed ten stuffs (and I got a bigger memory leak)

VB
Produce: 1
Produce: 2
Produce: 3
Produce: 4
Produce: 5
Produce: 6
Produce: 7
Produce: 8
Produce: 9
Produce: 10
Consume: 10
Consume: 9
Consume: 8
Consume: 7
Consume: 6
Consume: 5
Consume: 4
Consume: 3
Consume: 2
Consume: 1
Produce: 1


still reachable: 1,552 bytes in 4 blocks


for the last behavior, everything went fine (without memory leaks)

VB
Produce: 1
Produce: 2
Produce: 3
Produce: 4
Produce: 5
Produce: 6
Produce: 7
Produce: 8
Produce: 9
Produce: 10
Consume: 10
Consume: 9
Consume: 8
Consume: 7
Consume: 6
Consume: 5
Consume: 4
Consume: 3
Consume: 2
Consume: 1
Produce: 1


All heap blocks were freed -- no leaks are possible

GeneralRe: Memory leak in producer-consumer program Pin
Stefan_Lang26-Feb-13 22:21
Stefan_Lang26-Feb-13 22:21 
GeneralRe: Memory leak in producer-consumer program Pin
noislude26-Feb-13 22:27
noislude26-Feb-13 22:27 
GeneralRe: Memory leak in producer-consumer program Pin
Stefan_Lang26-Feb-13 23:01
Stefan_Lang26-Feb-13 23:01 
SuggestionRe: Memory leak in producer-consumer program Pin
noislude27-Feb-13 9:47
noislude27-Feb-13 9:47 
AnswerRe: Memory leak in producer-consumer program Pin
Vaclav_25-Feb-13 17:45
Vaclav_25-Feb-13 17:45 
QuestionWhat is the MFC future Pin
Arris7425-Feb-13 7:06
Arris7425-Feb-13 7:06 
AnswerRe: What is the MFC future Pin
Vaclav_25-Feb-13 9:46
Vaclav_25-Feb-13 9:46 
GeneralRe: What is the MFC future Pin
Richard Andrew x6425-Feb-13 10:07
professionalRichard Andrew x6425-Feb-13 10:07 
AnswerRe: What is the MFC future Pin
yu-jian25-Feb-13 21:30
yu-jian25-Feb-13 21:30 
GeneralRe: What is the MFC future Pin
Pete O'Hanlon26-Feb-13 3:30
mvePete O'Hanlon26-Feb-13 3:30 
AnswerRe: What is the MFC future Pin
Stefan_Lang26-Feb-13 3:16
Stefan_Lang26-Feb-13 3:16 
GeneralRe: What is the MFC future Pin
yu-jian26-Feb-13 17:44
yu-jian26-Feb-13 17:44 
AnswerRe: What is the MFC future Pin
_AnsHUMAN_ 27-Feb-13 1:42
_AnsHUMAN_ 27-Feb-13 1:42 
AnswerRe: What is the MFC future Pin
Joe Woodbury4-Mar-13 12:00
professionalJoe Woodbury4-Mar-13 12:00 
QuestionWere is a source of "sal.h" header file? Pin
Vaclav_25-Feb-13 5:19
Vaclav_25-Feb-13 5:19 
AnswerRe: Were is a source of "sal.h" header file? Pin
Richard MacCutchan25-Feb-13 5:44
mveRichard MacCutchan25-Feb-13 5:44 
GeneralRe: Were is a source of "sal.h" header file? Pin
Vaclav_25-Feb-13 5:52
Vaclav_25-Feb-13 5:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.