Heap Vs/And Data Segment

M

mailursubbu

Hi,

Is heap and Data Segment are same? Are they slightly different??

Best Regards,
Subra...
 
E

Eric Sosman

Hi,

Is heap and Data Segment are same? Are they slightly different??

As far as the C language is concerned, they are exactly
the same: neither exists.

Some concrete implementations of C use these terms to
describe regions of memory that the implementation handles
differently, but that's a detail of the implementation and
not a feature of the language.

<off-topic>

In some implementations, a "data segment" is a region of
memory initialized by copying its contents from a portion of
the executable program file, and perhaps applying some fixups
for address relocations and the like.

In some implementations, the "heap" is a data structure
describing the contents of a region of memory that can grow
at run-time to satisfy the demand for dynamically-allocated
memory.

</off-topic>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,188
Messages
2,571,002
Members
47,591
Latest member
WoodrowBut

Latest Threads

Top