![]() |
This article's factual accuracy is disputed. Please help to ensure that disputed facts are reliably sourced. See the relevant discussion on the talk page. (June 2011) |
This article may contain inappropriate or misinterpreted citations that do not verify the text. Please help improve this article by checking for inaccuracies. (help, talk, get involved!) (June 2011) |
A data segment is a portion of virtual address space of a program, which contains the global variables and static variables that are initialized by the programmer. This size of this segment is determined by the values placed there by the programmer before the program was compiled or assembled, and does not change at run-time.
The data segment is read-write, since the values of the variables can be altered at run-time. This is in contrast to the Rodata (constant, read-only data) section, as well as the code segment (also known as the text segment) which is read-only on many architectures.
The PC architecture supports a few basic read-write memory regions in a program namely: Stack, Data and Code. The heap is another region of address space available to a program, from which memory can be dynamically allocated or freed by the operating system in response to system calls such as malloc and free.
Contents |
The computer program memory is organized into the following:
The data area contains global and static variables used by the program that are explicitly initialized with a value. This segment can be further classified into a read-only area and read-write area. For instance, the string defined by char s[] = "hello world"
in C and a C statement like int debug=1
outside the "main" would be stored in initialized read-write area. And a C statement like const char* string = "hello world"
makes the string literal "hello world"
to be stored in initialized read-only area and the character pointer variable string
in initialized read-write area. Ex: both static int i = 10
and global int i = 10
will be stored in the data segment.
The BSS segment, also known as uninitialized data, starts at the end of the data segment and contains all global variables and static variables that are initialized to zero or do not have explicit initialization in source code. For instance a variable declared static int i;
would be contained in the BSS segment.
The heap area begins at the end of the BSS segment and grows to larger addresses from there. The heap area is managed by malloc, realloc, and free, which may use the brk and sbrk system calls to adjust its size (note that the use of brk/sbrk and a single "heap area" is not required to fulfill the contract of malloc/realloc/free; they may also be implemented using mmap to reserve potentially non-contiguous regions of virtual memory into the process' virtual address space). The heap area is shared by all shared libraries and dynamically loaded modules in a process.
The stack area traditionally adjoined the heap area and grew the opposite direction; when the stack pointer met the heap pointer, free memory was exhausted. (With modern large address spaces and virtual memory techniques they may be placed almost anywhere, but they still typically grow in opposite directions.)
The stack area contains the program stack, a LIFO structure, typically located in the higher parts of memory. On the standard PC x86 computer architecture it grows toward address zero; on some other architectures it grows the opposite direction. A "stack pointer" register tracks the top of the stack; it is adjusted each time a value is "pushed" onto the stack. The set of values pushed for one function call is termed a "stack frame"; A stack frame consists at minimum of a return address.
![]() |
This computer storage–related article is a stub. You can help Wikipedia by expanding it. |
Data is uninterpreted information.
Data or DATA may also refer to:
DATA were an electronic music band created in the late 1970s by Georg Kajanus, creator of such bands as Eclection, Sailor and Noir (with Tim Dry of the robotic/music duo Tik and Tok). After the break-up of Sailor in the late 1970s, Kajanus decided to experiment with electronic music and formed DATA, together with vocalists Francesca ("Frankie") and Phillipa ("Phil") Boulter, daughters of British singer John Boulter.
The classically orientated title track of DATA’s first album, Opera Electronica, was used as the theme music to the short film, Towers of Babel (1981), which was directed by Jonathan Lewis and starred Anna Quayle and Ken Campbell. Towers of Babel was nominated for a BAFTA award in 1982 and won the Silver Hugo Award for Best Short Film at the Chicago International Film Festival of the same year.
DATA released two more albums, the experimental 2-Time (1983) and the Country & Western-inspired electronica album Elegant Machinery (1985). The title of the last album was the inspiration for the name of Swedish pop synth group, elegant MACHINERY, formerly known as Pole Position.
Be by, be by my side tonight
'Cause it's nice to have your company once in a while.
Back and forth, I know how it feels
To lie in a circle, to ride on the wheel.
All I wanted was you to hold onto.
Just say that you'll be with me surely.
And then don't ever change your mind.
Back and forth...
Take me as I am, or take me not at all.
My sweetness has left me for dead.
You're all that I wanted.
Angel you captivate my mind
Say that you'll be with me till the end of time.
Won't you come into my life
You could be a flashlight in my night.
If I could reach to the sky
I'd set aside all the stars.
From which I'd build you a crown