请教一个C内存泄露问题# JobHunting - 待字闺中
g*y
1 楼
源代码就是一个2d数组的分配和删除:
编译运行以后发现,程序占用内存按照 4K/单位时间 的速度增加,请问这是怎么回事
呢?
#include
#include
int main()
{
while(1){
int i; /* general purpose variable used for loop index */
int j; /* general purpose variable used for loop index */
int **a; /* this is the array name */
int size_x; /* this variable will be used for the first dimension */
int size_y; /* this variable will be used for the second dimension */
/* suppose we want an array of int: a[5][3] */
size_x =
编译运行以后发现,程序占用内存按照 4K/单位时间 的速度增加,请问这是怎么回事
呢?
#include
#include
int main()
{
while(1){
int i; /* general purpose variable used for loop index */
int j; /* general purpose variable used for loop index */
int **a; /* this is the array name */
int size_x; /* this variable will be used for the first dimension */
int size_y; /* this variable will be used for the second dimension */
/* suppose we want an array of int: a[5][3] */
size_x =