•  Back 
  •  GEMDOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-FileMalloc()
Mxalloc()
Mfree()
Mshrink()                                                            GEMDOS

Syntax

WORD Mshrink( startadr, newsize )
VOIDP startadr;
LONG newsize;

Function      Mshrink() releases a portion of a block's memory to the
              GEMDOS free list.

Opcode        74 (0x4A)

Availability  All GEMDOS versions.

Parameters    startadr is the address of the block whose size you wish to
              decrease. newsize is the length you now desire for the
              block.

Binding       move.l   newsize,-(sp)
              pea      startadr
              clr.w    -(sp)  // Required/Reserved Value
              move.w   #$4A,-(sp)
              trap     #1
              lea      12(sp),sp

Return Value  Mshrink() returns E_OK (0) if the operation was successful
              or a negative GEMDOS error code otherwise.

Caveats       This call should be used only to 'shrink' a memory block,
              not to enlarge it.

See Also      Malloc(), Mxalloc(), Mfree()