Mail Archives: djgpp/2000/03/29/21:29:28
night DOT walker AT tiscalinet DOT it wrote:
> I must call sin() inside an timer function (i can't use a LUT, would be
> too inaccurate...)
> I don't know how can i lock the function code (without knowing the size)
Not reliably or easily, but you can always lookup the size of the
sin() function, once, multiply it by a factor of 2, for a safety
margin, and lock that amount of memory.
> However the program runs very well, even if i force it to swap
> filling all the ram, and even under w95 in background with lots of
> other programs running... On my computer, setting a timer and
> locking all but a single int makes a full crash...
Which probably means that your calls to sin() didn't actually touch
any unlocked memory. I'm not sure about the details, but this *might*
be because sin() is inlined to a single fsin assembly
instruction. Check your interrupt function's assembly output generated
by the compiler. Or it could be in the same page locked by some other
part of the code that happens to be close to it. Checking the locked
adresses agains that of sin() should help to test that.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -