Re: size_t or int for malloc-type functions?
- From: "Stephen Sprunk" <stephen@xxxxxxxxxx>
- Date: Wed, 3 Jan 2007 12:24:40 -0600
"Randy Howard" <randyhoward@xxxxxxxxxxxxxxxxx> wrote in message news:0001HW.C1C034C90338CB3CF0203648@xxxxxxxxxxxxxxxxxxx
On Tue, 2 Jan 2007 15:49:03 -0600, christian.bau wrote
(in article <1167774543.858326.104530@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>):
And most 32 bit systems have limit at 3GB or 3.5GB.
Actually it's usually 2GB, due to splitting of address space between
the kernel and user space. Some go as high as 3GB with special boot
options.
RedHat has a special Linux kernel that gives just under 4GB of user address space; a bit of kernel space is still required to keep syscalls working, but it's pretty small. It's mainly used by database folks, who should be moving to AMD64 now anyways (with its 2^51 bytes of user space, currently).
However, there are hacks (outside of malloc) that allow for
what Intel calls "Physical Address Extension" (PAE) to allow
systems with Intel 32-bit processors to see memory above 4GB, sort
of like the old extended/expanded memory hacks in the DOS days.
Again, proprietary, and different APIs to use the memory from what
standard C supports.
A single process will never see more than 32 bits of memory at a time, since both the virtual and linear address spaces are limited to that size. What PAE does is allow the OS to map those 32 bits of per-process linear address space into 36 bits of physical address space. That means you still can't have more than 4GB in a single app, but you could run sixteen apps that each have their own 4GB without conflict.
Some OSes may provide a way for processes to "see" different parts of the 36-bit space at various times, similar to how EMS allowed 16-bit apps to "see" different 1MB chunks of a 16MB physical address space. Obviously that requires a lot of non-portable trickery to ensure the right memory chunk is in place when you dereference a pointer.
S
--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking
--
Posted via a free Usenet account from http://www.teranews.com
.
- References:
- Re: size_t or int for malloc-type functions?
- From: Stephen Sprunk
- Re: size_t or int for malloc-type functions?
- From: Kenny McCormack
- Re: size_t or int for malloc-type functions?
- From: christian.bau
- Re: size_t or int for malloc-type functions?
- From: Randy Howard
- Re: size_t or int for malloc-type functions?
- Prev by Date: Re: How to generate a Guassion Sample data?
- Next by Date: Re: How to generate a Guassion Sample data?
- Previous by thread: Re: size_t or int for malloc-type functions?
- Next by thread: Re: size_t or int for malloc-type functions?
- Index(es):
Relevant Pages
|