Mail Archives: djgpp/1997/08/06/02:34:51
Georg Kolling writes:
>1. How can i prevent GCC from using a certain segment register?
> Or doesnt it use all segment registers? (Well, cs for code, ds for data,
> ss for stack, fs for _far stuff... es and gs seem to be unused!)
%cs, %ds, %es, and %ss are used by gcc generated code, and should
therefore be left alone (obviously you could change them within an asm
routine of your own, but be sure to put them back when you are done).
Some library functions use %gs, but %fs is free for whatever you want to
do with it, eg. you can _farsetsel() in your setup code, and as long as
you don't change it later, it will stay set to that value.
>2. Does realloc always return the same pointer if i try to shrink a previously
> allocated chunk of memory?
I'm not sure about the gcc malloc implementation, but I have in the past
used compilers that did move the block around (it took me forever to
work out why my code suddenly stopped working when I changed compiler!).
It's probably not a good plan to assume that it will stay in the same
place...
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.
- Raw text -