calloc v/s malloc and time efficiency

前端 未结 7 1218
抹茶落季
抹茶落季 2021-02-04 08:12

I\'ve read with interest the post C difference between malloc and calloc. I\'m using malloc in my code and would like to know what difference I\'ll have using calloc instead.

7条回答
  •  走了就别回头了
    2021-02-04 08:29

    I dont know for linux. But on Windows there is something called the zero-page thread... calloc use those pages already initialized to zero. There is no difference in speed between malloc and calloc.

提交回复
热议问题