- 论坛徽章:
- 1
|
关于c语言中的free()函数的问题,高手们请进!!
If free() or realloc() is passed a pointer that was not the result of
a call to malloc(), realloc(), calloc(), or valloc(), or if space
assigned by an allocation function is overrun, loss of data, a memory
fault, bus error, or an infinite loop may occur at that time or during
any subsequent call to malloc(), realloc(), calloc(), valloc(), or
free().
The following actions are not supported and cause undesirable effects:
+ Attempting to free() or realloc() a pointer not generated as
the result of a call to malloc(), realloc(), calloc(), or
valloc().
The following actions are strongly discouraged and may be unsupported
in a future implementation of malloc():
+ attempting to free() the same block twice,
Standard input
+ depending on unmodified contents of a block after it has been
freed.
Undocumented features of earlier memory allocators have not been
duplicated. |
|