OSHeap_Resize Should Have R3 as Output.
Kevin Bracey
kevin.bracey at pace.co.uk
Mon Nov 5 11:36:34 GMT 2001
In message <200111032244.WAA05203 at inputplus.demon.co.uk>
Ralph Corderoy <ralph at inputplus.demon.co.uk> wrote:
> OSLib's entry doesn't match the PRM WRT R3.
>
> SWI OSHeap_Resize =
> ( NUMBER &1D,
> ENTRY
> ( R0 # 5 "Extends or shrinks a heap (PRM 1-375)",
> R1 = .Ref .Data: heap,
> R3 = .Int: size_increase
> )
> );
>
> OS_Heap 5 (SWI &1D)
>
> Extend or shrink heap
>
> On entry
> R0 = 5 (reason code)
> R1 = pointer to heap
> R3 = required size change in bytes (signed integer)
>
> On exit
> R0, R1 preserved
> R3 preserved, or amount of bytes heap shrunk by if requested
> shrink failed
>
> Use
> This updates the heap size information to take account of the
> new size. If the heap cannot shrink as far as requested -
> because of data that has already been allocated - it will
> shrink as far as possible, set R3 to the amount by which it
> shrank, and return an error.
>
> Is this a bug or a sign of my unfamiliarity with OSLib's ways.
>
OSLib veneers won't update any return registers in the event of an error,
which is unfortunate for SWIs like OS_Heap 5 or OS_ChangeDynamicArea. I'd
imagine this is why R3 return has been omitted.
--
Kevin Bracey, Principal Software Engineer
Pace Micro Technology plc Tel: +44 (0) 1223 518566
645 Newmarket Road Fax: +44 (0) 1223 518526
Cambridge, CB5 8PB, United Kingdom WWW: http://www.pace.co.uk/
More information about the oslib-user
mailing list