use more memory thanvoid do_simulation() { struct s* m; m = (struct s*)malloc(10000000 * sizeof(struct s)); free(m); m = (struct s*)malloc(10000000 * sizeof(struct s)); free(m); }
void do_simulation() { struct s* m = (struct s*)malloc(10000000 * sizeof(struct s)); free(m); }
It could be that the memory is being pout back into Perl's free memory pool and you just don't realize it.
In reply to Re: Calling a C function using malloc() in a XS
by ikegami
in thread Calling a C function using malloc() in a XS
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |