Liste des Groupes | Revenir à cl c |
It is perfectly safe. One can even argue that standard declaration if `free` as `void free(void *)` is defective. It should have been `void free(const void *)` from the very beginning.It is common in simple heap implementations for the allocated block to contain data about the block, such as allocation sizes and pointers to other blocks, in memory just below the address returned by malloc. free() then uses its parameter to access that data, and may change it. So "void free(const void *);" would be lying to the user.
Les messages affichés proviennent d'usenet.