Re: Seeking info on wParam and lParam
- From: erewhon@xxxxxxxxxx (J French)
- Date: Wed, 24 Aug 2005 13:16:34 +0000 (UTC)
On Wed, 24 Aug 2005 03:38:17 -0700, "Sam Hobbs"
<samuel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>"Tom Esh" <tjeshGibberish@xxxxxxxxxx> wrote in message
>news:99sng11iov9mgplaklt98aj8dvkpsusp3g@xxxxxxxxxx
>> I'd say the reason probably has to do with
>> the efficiency of pushing args into registers or the stack vs a
>> pointer. No doubt less significant today than back in the early days,
>> but I'd bet reading registers or popping values off the stack is still
>> faster than resolving a FAR pointer.
>It is not the pointer that is inefficient, it is the memory that must be
>allocated in the application's address space that is inefficient. The
>inefficiencies include fragmentation. Since there are so many messages
>processed by windows, allocation of memory for each message would be very
>inefficient, especially in systems that existed when Windows was developed.
>Whenever the mouse is moved, many WM_MOUSEMOVE messages are sent.
>Inefficient processing of that message could easily cause a system to be
>useless.
wParam and lParam come from 16 bit windows
In those days 16 bits were a lot more efficient than 32 bits, so the
wParam was a 'signal' on the stack and the lParam was a ES:SI type
pointer .. if needed
With Win32 (32 bit throughout) it is a lot more efficient to work with
multiples of 4 bytes (32 bits) so they simply lengthened the wParam (
Word Parameter )
Quite sensible, as few people would even notice
Realistically it was just an opportunity for 'fine tuning'
- also future development (widening wParam opens unused options)
Any speed changes would be insignificant
- a mouse move creates more havoc than 10,000 non optimally aligned
stack parameters
.
- Follow-Ups:
- Re: Seeking info on wParam and lParam
- From: Sam Hobbs
- Re: Seeking info on wParam and lParam
- From: Joseph Geretz
- Re: Seeking info on wParam and lParam
- References:
- Seeking info on wParam and lParam
- From: Joseph Geretz
- Re: Seeking info on wParam and lParam
- From: Tom Esh
- Re: Seeking info on wParam and lParam
- From: Sam Hobbs
- Seeking info on wParam and lParam
- Prev by Date: Re: gettickcount returns a negative number???
- Next by Date: Re: gettickcount returns a negative number???
- Previous by thread: Re: Seeking info on wParam and lParam
- Next by thread: Re: Seeking info on wParam and lParam
- Index(es):
Relevant Pages
|