On Thu, Apr 21, 2011 at 3:17 PM, Wan Mohd Fairuz Wan Ismail <[email protected]> wrote: > Hi, > I want to share my findings which I don't really understand and hope > some explanations from you guys. I compiled a simple program as below: > #include <stdio.h> > #include <stdlib.h> > int main() > { > char *p; > // Allocation #1 of 19 bytes > p = (char *) malloc(19); > // Allocation #2 of 12 bytes > p = (char *) malloc(12); > free(p); > // Allocation #3 of 16 bytes > p = (char *) malloc(16); > return 0; > } > I've compiled using the commands below: > gcc -o test-x86 -g simple.c > gcc -o test-x86-static -g -static simple.c > arm-none-linux-gnueabi-gcc -o test-arm -g simple.c > arm-none-linux-gnueabi-gcc -o test-arm-static -g -static simple.c
I wonder if the compiler is optimizing away the function calls. Try using -O1 or -O0 when compiling. - Dan ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
