Skip to Content
Amiga Assembly Library v41.21 — Motorola 68020 shared library for Commodore Amiga

FreeList

Synopsis

FreeList(list) A0

C Prototype

void FreeList(struct List *list);

Description

Removes all nodes from a list, frees the memory occupied by each node (which MUST have been added using AllocNode()), and then frees the memory occupied by the List structure itself.

Inputs

  • list — Address of an initialized List structure to free.

Result

None.

See Also

FreeNode, FreeListName

Implementation

The original 68020 assembly implementation:

; (07-Feb-1995) --- FreeList(list) (a0) _LVOFreeList movem.l a4-a6,-(sp) move.l a0,a4 ; A4 = struct List * move.l ab_ExecBase(a6),a6 ; Get Exec right away... FLCont move.l (a4),a1 move.l (a1),d0 beq.s FLFrLst ; Go free the List structure move.l a1,a5 ; Save for FreeMem() move.l a4,a0 ; struct List * REMOVE ; exec MACROS lea -4(a5),a1 moveq #4+LN_SIZE,d0 jsr _LVOFreeMem(a6) bra.s FLCont FLFrLst lea -4(a4),a1 moveq #4+LH_SIZE,d0 jsr _LVOFreeMem(a6) movem.l (sp)+,a4-a6 rts
Last updated on