Real reallocation is rarely needed and is dependent on value semantics, on copy semantics and sharing of data structures. For real life objects stupid plain memcopy is hardly suitable, so you just can't write one big universal reallocation function. Even the idea of realloc is rather stupid, an object usually consists of several fixed size fields and several variable size fields and it is not a good idea to copy all of them if only one variable size field doesn't fit into its memory
Обсуждают сегодня