Why are malloc() and printf() said as non-reentrant?

后端 未结 6 1512
深忆病人
深忆病人 2020-11-29 19:25

In UNIX systems we know malloc() is a non-reentrant function (system call). Why is that?

Similarly, printf() also is said to be non-reent

6条回答
  •  独厮守ぢ
    2020-11-29 20:10

    Most likely because you can't start writing output while another call to printf is still printing it's self. The same goes for memory allocation and deallocation.

提交回复
热议问题