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

Program memory [link]

The computer program memory is organized into the following:

Data [link]

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.

BSS [link]

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.

Heap [link]

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.

Stack [link]

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.

References [link]

See also [link]

External links [link]


https://wn.com/Data_segment

Data (disambiguation)

Data is uninterpreted information.

Data or DATA may also refer to:

  • Data (computing), in computer science, often distinguished from code or software
  • Data (Euclid), a book by Euclid
  • Data (moth), a moth genus
  • Data (Star Trek), a fictional android in the Star Trek universe
  • Data URI scheme
  • Design and Technology Academy, a school in San Antonio, Texas, USA
  • Durham Area Transit Authority, the public transit agency serving Durham, North Carolina, USA
  • Data, a character in The Goonies
  • DATA, a diaryltriazine, a class of organic molecules
  • DATA, a non-governmental organization founded by Bono
  • Draughtsmen's and Allied Technicians' Association, a defunct British trade union
  • Data (word), for the word "data" in English
  • Music

  • Data Records, a record label
  • DATA (band), a techno-pop band created by Georg Kajanus
  • DatA, French electro musician
  • Data, British drum and bass musician
  • DATA (band)

    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.

    Data (word)

    The word data has generated considerable controversy on if it is a singular, uncountable noun, or should be treated as the plural of the now-rarely-used datum.

    Usage in English

    In one sense, data is the plural form of datum. Datum actually can also be a count noun with the plural datums (see usage in datum article) that can be used with cardinal numbers (e.g. "80 datums"); data (originally a Latin plural) is not used like a normal count noun with cardinal numbers and can be plural with such plural determiners as these and many or as a singular abstract mass noun with a verb in the singular form. Even when a very small quantity of data is referenced (one number, for example) the phrase piece of data is often used, as opposed to datum. The debate over appropriate usage continues, but "data" as a singular form is far more common.

    In English, the word datum is still used in the general sense of "an item given". In cartography, geography, nuclear magnetic resonance and technical drawing it is often used to refer to a single specific reference datum from which distances to all other data are measured. Any measurement or result is a datum, though data point is now far more common.

    Data (moth)

    Data is a genus of moths of the Noctuidae family.

    Species

  • Data aroa (Bethune-Baker, 1906)
  • Data callopistrioides (Moore, 1881)
  • Data clava (Leech, 1900)
  • Data dissimilis Warren, 1911
  • Data eriopoides Prout, 1928
  • Data manta (Swinhoe, 1902)
  • Data obliterata Warren, 1911
  • Data ochroneura (Turner, 1943)
  • Data pratti (Bethune-Baker, 1906)
  • Data rectisecta Warren, 1912
  • Data rhabdochlaena Wileman & West, 1929
  • Data thalpophiloides Walker, 1862
  • Data variegata (Swinhoe, 1895)
  • References

  • Natural History Museum Lepidoptera genus database
  • Data at funet
  • Data (Star Trek)

    Lieutenant Commander Data (/ˈdtə/ DAY-tə) is a character in the fictional Star Trek universe portrayed by actor Brent Spiner. He appears in the television series Star Trek: The Next Generation and the feature films Star Trek Generations, Star Trek: First Contact, Star Trek: Insurrection and Star Trek: Nemesis.

    An artificial intelligence and synthetic life form designed and built by Doctor Noonien Soong, Data is a self-aware, sapient, sentient, and anatomically fully functional android who serves as the second officer and chief operations officer aboard the Federation starships USS Enterprise-D and USS Enterprise-E. His positronic brain allows him impressive computational capabilities. Data experienced ongoing difficulties during the early years of his life with understanding various aspects of human behavior and was unable to feel emotion or understand certain human idiosyncrasies, inspiring him to strive for his own humanity. This goal eventually led to the addition of an "emotion chip", also created by Soong, to Data's positronic net. Although Data's endeavor to increase his humanity and desire for human emotional experience is a significant plot point (and source of humor) throughout the series, he consistently shows a nuanced sense of wisdom, sensitivity, and curiosity, garnering immense respect from his peers and colleagues.

    Podcasts:

    PLAYLIST TIME:
    ×