Re: malloc realloc and pointers
- From: Nick Keighley <nick_keighley_nospam@xxxxxxxxxxx>
- Date: Fri, 30 Nov 2007 02:30:03 -0800 (PST)
On 29 Nov, 21:44, Peter Nilsson <ai...@xxxxxxxxxxx> wrote:
ravi <nos...@xxxxxxxxxxxxxx> wrote:
I m relatively new to C.
Then why ask questions on how it's implemented? You're
trying to run before you can crawl.
in theory this is the right answer but some people need
a concrete implementation to hang their thoughts on.
E1: "but you don't need to know the dtails of how that works!"
E2: "yes I do!"
E1: "you wouldn't expect to know the dtails of how the compiler
worked would you?"
E2: "well yes I would actually"
"I understood once I realised it's all shift registers!"
an explanation of the functioning of a digital switch,
that I felt lacked detail.
I have few queries related to malloc():
1. When we perform malloc(), the memory allocated
dynamically comes from the heap area of the process in
concern.
If you say so. The language standard does not specify how
malloc is implemented, merely how it must operate.
again, an outline sketch of an implementation can help.
Well, we then say that the heap has shrinked. my query
is: Is it that the heap physically does not shrink but
the perticular nodes are marked 'ALLOCATED' and for
subsequent calls to malloc() the memory manager
remembers them and does not reference them?
typically, yes (actually pretty well certainly, yes!)
<snip>
--
Nick Keighley
.
- References:
- malloc realloc and pointers
- From: ravi
- Re: malloc realloc and pointers
- From: Peter Nilsson
- malloc realloc and pointers
- Prev by Date: Re: rpcgen cannot find any C Preprocessor
- Next by Date: Is this C?
- Previous by thread: Re: malloc realloc and pointers
- Next by thread: Re: malloc realloc and pointers
- Index(es):