realloc, copy and VM
- From: Jean-Claude Arbaut <jean-claude.arbaut@xxxxxxxxxxx>
- Date: Sat, 25 Jun 2005 00:20:18 +0200
When you realloc for more size, it may be necessary to allocate a new block,
copy memory and deallocate the old, for example if there is not enough free
space after the original block (maybe the only example ?). But, is it really
necessary to _copy_ bytes ? When in a virtual memory environment (off-topic
here, be I still think the question is worth), you don't access directly
physical memory, but allocated pages, so would it be possible on some
implementations, to just change page allocation ? Some kind of immobile
trip. It could permit optimizations even when not knowing beeforehand the
exact amount of memory needed.
.
- Follow-Ups:
- Re: realloc, copy and VM
- From: Michael Wojcik
- Re: realloc, copy and VM
- From: Keith Thompson
- Re: realloc, copy and VM
- From: Anonymous 7843
- Re: realloc, copy and VM
- From: Gordon Burditt
- Re: realloc, copy and VM
- Prev by Date: Re: Origin of size_t? Curious.
- Next by Date: Re: realloc, copy and VM
- Previous by thread: compiler unable to find defn. of sin()
- Next by thread: Re: realloc, copy and VM
- Index(es):
Relevant Pages
|
|