Re: More questions on realloc - Thanks
- From: Jordan Abel <jmabel@xxxxxxxxxx>
- Date: Tue, 29 Nov 2005 21:38:03 +0000 (UTC)
On 2005-11-29, S.Tobias <siXtY@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> James S. Singleton <pt109@xxxxxxxxxx> wrote:
>> b) Implementing realloc(ptr, size) using malloc(), memcpy() and free()
>> alone, without knowing the size of the memory region pointed to by ptr, is
>> just not possible.
>
> True, in standard C it's not possible.
>
> But note that `malloc' and `free' are redundant and can be implemented
> in terms of `realloc'.
free() can't, unless a size request of 0 does not cause an allocation
[which is not guaranteed.]
.
- References:
- More questions on realloc - Thanks
- From: James S. Singleton
- Re: More questions on realloc - Thanks
- From: S.Tobias
- More questions on realloc - Thanks
- Prev by Date: Re: Array size depending on symbol address
- Next by Date: Re: format of double and __int64
- Previous by thread: Re: More questions on realloc - Thanks
- Next by thread: PayPal Opportunity
- Index(es):
Relevant Pages
|