Re: Kernel malloc/realloc?
From: Doron Holan [MS] (doronh_at_nospam.microsoft.com)
Date: 02/05/04
- Next message: Doron Holan [MS]: "Re: Side buttons for IntelliMouse Explorer does not work on Win 2003 Server"
- Previous message: Bogdan Bejan: "Re: Identifying the attachments"
- In reply to: Bogdan Bejan: "Re: Kernel malloc/realloc?"
- Next in thread: Bogdan Bejan: "Re: Kernel malloc/realloc?"
- Reply: Bogdan Bejan: "Re: Kernel malloc/realloc?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 4 Feb 2004 20:38:15 -0800
one of the semantics of realloc is that the same pointer as before can be
returned (i haven't used realloc in such a long time, i can't remember if
this true 100% of the time or not). Based on this assumption if you were to
resize a buffer, you would need to
1) make sure any threads that are using the previous buffer have stopped
using it
2) update the field which contains the pointer value so that no one picks
up the old value and starts using the new one
d
-- This posting is provided "AS IS" with no warranties, and confers no rights. Please reply to newsgroups only. "Bogdan Bejan" <na@na.na> wrote in message news:ufvFlI36DHA.2952@TK2MSFTNGP09.phx.gbl... > I wasn't sure is shuch API exists in kernel, thanx for clearing it. > > "Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote in message > news:uocOjcs6DHA.1556@tk2msftngp13.phx.gbl... > > no such API exists. you must be able to update the pointer value > atomically > > if you need to have a bigger allocation > > Don't you have to update the pointer with realloc to? Isn't realloc based on > GlobalRealloc?Which i suppose works by allocating more hardware pages and > mapping them in a new vitual location, where you have enough virtual space > for the new buffer? > > > > > d > > > > -- > > This posting is provided "AS IS" with no warranties, and confers no > rights. > > Please reply to newsgroups only. > > > > "Bogdan Bejan" <na@na.na> wrote in message > > news:euNZM9r6DHA.2764@TK2MSFTNGP09.phx.gbl... > > > How can you alocate then realocate a memory buffer in kernel mode (W2k+) > ? > > > > > > > > > > > >
- Next message: Doron Holan [MS]: "Re: Side buttons for IntelliMouse Explorer does not work on Win 2003 Server"
- Previous message: Bogdan Bejan: "Re: Identifying the attachments"
- In reply to: Bogdan Bejan: "Re: Kernel malloc/realloc?"
- Next in thread: Bogdan Bejan: "Re: Kernel malloc/realloc?"
- Reply: Bogdan Bejan: "Re: Kernel malloc/realloc?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|