Re: Newbie - Shared library



Joseph2k <joseph2k@xxxxxxxxxx> writes:

> Ray wrote:
>
>> On Thu, 2005-12-15 at 00:21 -0500, Carlos Moreno wrote:
>>
>>> You have to understand that in C++, like in C, you have two
>>> distinct notions: declaration and definition.
>>>
>> Yes. A declaration merely reserves space in RAM for the class or
>> variable. A definition tells the computer what's going to be IN that
>> space.
>>
>>
>>
> No, function and class declaration does not. Function or class declaration
> reserves namespace and possibly a pointer to linkage for something. Only
> variable declaration can reserve space memory.

A variable declaration doesn't reserve memory either. Consider

extern int foo;

That's a declaration, not a definition, and so does not reserve
memory. A variable *definition*, which does reserve memory, looks
like

int foo;

or

static int foo;

Ray was thinking of the difference between definition and
initialization. In the case of variables, the former reserves space,
the latter also specifies the data. Functions are a little different
in that they can never be defined without also being "initialized".
They will also typically be stored in read-only memory pages.

--
Måns Rullgård
mru@xxxxxxxxxxxxx
.



Relevant Pages

  • [RFC][PATCH 0/9] Network receive deadlock prevention for NBD
    ... Convergence of network and storage paths" ... "Net vm deadlock fix " ... Maybe it is another memory deadlock, ... dipping into the memalloc reserve if it must. ...
    (Linux-Kernel)
  • Re: [PATCH 00/28] Swap over NFS -v16
    ... memory they can consume. ... So we need the extra (skb) ... included in the reserve? ... if the allocation had to dip into emergency reserves, ...
    (Linux-Kernel)
  • Re: Windows 2000 Server StandardEdition /PAE Question
    ... I would like to add here that the reserved memory address space by the devices is not necessarily reserved to talk to the processor. ... They may not necessarily talk to the processor at those addresses but the end result is the same, the private addresses will be marked as off limits to the processor and the RAM will still end up short of addresses in the lower 4GB memory arena. ... For example, the BIOS and system board will reserve and use a bit less than 1 megabyte of address space directly at the processor, when the processor needs to talk with the BIOS or motherboard it will do so directly by using their reserved addresses, the addresses reserved by and given to the system board cannot be used by the RAM. ... Windows 2000 Professional, Windows 2000 Server, Windows XP 32-bits and Vista 32-bits do not make full use of this /PAE feature, they are unable to use RAM addressed above the 4GB boundary. ...
    (microsoft.public.win2000.general)
  • Re: [PATCH] reserve end-of-conventional-memory to 1MB on 32-bit
    ... This patch adds explicit detection of the EBDA and reservation ... the EBDA size was hardcoded as 4Kb. ... we'll fake a memory map. ... * workaround for Dell systems that neglect to reserve EBDA ...
    (Linux-Kernel)
  • FlashROM as as a FAT-disk in CE 5.0?
    ... Eboot.bib and virtual memory map and possibly ... RAM 83100000 $RAM ... Reserve ZBANK virtual block (No physical memory ...
    (microsoft.public.windowsce.platbuilder)