search for: functioncalled10mtimesinsomeloop

Displaying 2 results from an estimated 2 matches for "functioncalled10mtimesinsomeloop".

2009 Mar 26
0
[LLVMdev] GSoC'09 question
...d some shape analysis. This summer however, I plan to create an "optimization" that automatically fixes memory leaks in programs - obviously only those that can be fixed with the available information, for example: int addAndFree(int *x, int y) { y += *x; free(x); return y; } int functionCalled10MTimesInSomeLoop(int index, int data[]) { int *x = (int*)malloc(sizeof(int)); if(index < 3) { // do stuff with x, index and data *x = data[index]; return addAndFree(x,index); } else return -1; } the function would not leak if that free instruction was copied in bb2: before ret (see bellow: -O4 versio...
2009 Mar 26
3
[LLVMdev] GSoC'09 question - previous mail w/o html
...d some shape analysis. This summer however, I plan to create an "optimization" that automatically fixes memory leaks in programs - obviously only those that can be fixed with the available information, for example: int addAndFree(int *x, int y) { y += *x; free(x); return y; } int functionCalled10MTimesInSomeLoop(int index, int data[]) { int *x = (int*)malloc(sizeof(int)); if(index < 3) { // do stuff with x, index and data *x = data[index]; return addAndFree(x,index); } else return -1; } the function would not leak if that free instruction was copied in bb2: before ret (see bellow: -O4 versio...