Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Handle-based vs pointer-based memory allocation system

42 views
Skip to first unread message

Joe Boctor

unread,
Feb 14, 2001, 8:55:00 PM2/14/01
to

Hi!

Anybody knows any advantages of using handle-based memory allocation
system vs pointer-based?

Any input is appreciated!
Joe

news.boi.hp.com

unread,
Mar 8, 2001, 10:31:42 AM3/8/01
to
I think, this is a relict from MS Windows 2.x and 3.0 (Standard Mode), not
an advantage. In old (but not older) times PCs has more memory than 640 KB
(which is accessible in i86 real mode), and other memory was far away (EMS,
XMS). The Memory Handle was a way how to allocate it and LocalLock() and
GlobalLock() was a way how to make this memory accesible in "low 640KB"
memory.

The details of explanation depends on the PC XT and/or AT architecture and
on using i86 "real mode" CPU.

Dave

Joe Boctor <jmbo...@rees.math.uwaterloo.ca> wrote in message
news:Pine.SOL.4.05.101021...@rees.math.uwaterloo.ca...

John Smith

unread,
Mar 9, 2001, 7:06:50 AM3/9/01
to
> Joe Boctor <jmbo...@rees.math.uwaterloo.ca> wrote in message
> news:Pine.SOL.4.05.101021...@rees.math.uwaterloo.ca...
> >
> > Hi!
> >
> > Anybody knows any advantages of using handle-based memory allocation
> > system vs pointer-based?
> >

Handle-based allocated memory can be moved around freely by the OS to
reclaim/move around allocated blocks. Pointer-based allocated memory
can't.

Chris Marriott

unread,
Mar 14, 2001, 1:46:52 AM3/14/01
to

John Smith <smi...@notreal.com> wrote in message
news:uH3q6.312733$j6.43...@news1.rdc1.va.home.com...

That's incorrect. John. On an Intel CPU, a pointer is not pointing directly
at memory; it's pointing at a process's "virtual address space". The o/s can
move memory around without invalidating pointers. Handle based memory
allocation systems are primarily a "throwback" to older operating systems
running on CPUs which didn't support this virtual memory mechanism - eg,
Windows 2 and the older versions of the Mac OS.

Regards,

--
Chris
-----------------------------------------------------------------------
Chris Marriott, SkyMap Software, UK (ch...@skymap.com)
Visit our web site at http://www.skymap.com
Astronomy software written by astronomers, for astronomers

Rich Gade

unread,
Mar 14, 2001, 2:13:42 AM3/14/01
to

That's entirely dependent on the MMU and CPU. With an advanced (modern
by personal computer terms) MMU the OS can move things around quite
comfortably even with pointer based allocation. The processes' view of
memory doesn't have to remotely represent what's actually in "core".
It's a bit more constricted, but not enough to be a detriment.

Sylvan Butler

unread,
Mar 14, 2001, 5:57:30 PM3/14/01
to
On Wed, 14 Mar 2001 06:46:52 -0000, Chris Marriott <ch...@nospam.chrism.demon.co.uk> wrote:
>
>John Smith <smi...@notreal.com> wrote in message
>news:uH3q6.312733$j6.43...@news1.rdc1.va.home.com...
>> > Joe Boctor <jmbo...@rees.math.uwaterloo.ca> wrote in message
>> > news:Pine.SOL.4.05.101021...@rees.math.uwaterloo.ca...
>> > >
>> > > Hi!
>> > >
>> > > Anybody knows any advantages of using handle-based memory allocation
>> > > system vs pointer-based?
>> > >
>>
>> Handle-based allocated memory can be moved around freely by the OS to
>> reclaim/move around allocated blocks. Pointer-based allocated memory
>> can't.
>
>That's incorrect. John. On an Intel CPU, a pointer is not pointing directly
>at memory; it's pointing at a process's "virtual address space". The o/s can

(which looks like "directly at memory" to the process, but the
address in that pointer is not the address of any physical memory)

>move memory around without invalidating pointers. Handle based memory
>allocation systems are primarily a "throwback" to older operating systems
>running on CPUs which didn't support this virtual memory mechanism - eg,
>Windows 2 and the older versions of the Mac OS.

Exactly. A very good explanation.

The process has a memory address in the pointer, and the hardware,
when given that address, uses a mapping table provided by the
operating system to translate it to a physical memory address.

The specific hardware that allows this memory managment is the
Memory Management Unit, or MMU. All the Intel x86 line since and
include the 80386 contain an MMU. Many other processors or
processor systems (e.g. for some of the motorola 68k family the MMU
was a seperate add-on chip) also contain an MMU.

The MMU also allows "virtual memory", when the table does not
contain a physical address equivalent, the hardware generates a
"page fault" which tells the OS "we are missing an entry in the
page table, what should I do?"

sdb

--
| Sylvan Butler | Not speaking for Hewlett-Packard | sbutler-boi.hp.com |
| Watch out for my e-mail address. Thank UCE. #### change ^ to @ #### |
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. --Benjamin Franklin, 1759
"Don't Tread On Me!"

0 new messages