What is the maximum size of buffers memcpy/memset etc. can handle?

前端 未结 6 2084
执笔经年
执笔经年 2020-12-11 04:54

What is the maximum size of buffers memcpy and other functions can handle? Is this implementation dependent? Is this restricted by the size(size_t) passed in as an argument?

6条回答
  •  借酒劲吻你
    2020-12-11 05:32

    Right, you cannot copy areas that are greater then 2^(sizeof(size_t)*8) bytes. But that is nothing to worry about, because you cannot allocate more space either, because malloc also takes the size as a size_t parameter.

提交回复
热议问题