From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) Newsgroups: comp.os.msdos.djgpp Subject: Re: __djgpp_base_address Date: 14 Mar 1997 09:04:04 GMT Organization: The National Capital FreeNet Lines: 35 Message-ID: <5gb4a4$got@freenet-news.carleton.ca> References: <199703051831 DOT MAA141402 AT audumla DOT students DOT wisc DOT edu> <332200de DOT SANDMANN AT clio DOT rice DOT edu> <5g0ao0$sjl AT freenet-news DOT carleton DOT ca> <3325c197 DOT 1560353 AT news DOT demon DOT co DOT uk> Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) NNTP-Posting-Host: freenet3.carleton.ca To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Alaric B. Williams (alaric AT abwillms DOT demon DOT co DOT uk) writes: > On 10 Mar 1997 06:46:24 GMT, ao950 AT FreeNet DOT Carleton DOT CA (Paul > Derbyshire) wrote: > >>Two questions: > >>* This seems to say that something like this won't work: > >> char *the_ptr; >> the_ptr=malloc(the_size); >> _go32_lock_data_memory(the_ptr,size); (syntax? not sure) > >> because later the data may find itself moved somewhere (despite being >> locked?) while the locked memory stays put? > > No. The addresses of things can't change behind the scenes - a > restriction of the C language due to pointer casting problems - so > once you lock something, it's locked; you lock the *virtual* address > range, not the physical address, which is subject to change. Anyway, > the above code /is/ wrong - you must lock the pointer AND what it > points to! Oops, I know this, I forgot since I was typing a usenet posting and not writing real useful code. :) char *the_ptr; the_ptr=malloc(the_size); _go32_lock_data_memory(the_ptr,size); (syntax? not sure) _go32_lock_data_memory(&the_ptr,sizeof(char *)); -- .*. Where feelings are concerned, answers are rarely simple [GeneDeWeese] -() < When I go to the theater, I always go straight to the "bag and mix" `*' bulk candy section...because variety is the spice of life... [me] Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh