2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Free memory allocated with AllocEntry().
8 #include "exec_intern.h"
9 #include <aros/libcall.h>
10 #include <exec/memory.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
17 AROS_LH1(void, FreeEntry
,
20 AROS_LHA(struct MemList
*, entry
,A0
),
23 struct ExecBase
*, SysBase
, 38, Exec
)
27 Free some memory allocated with AllocEntry().
30 entry - The MemList you got from AllocEntry().
45 ******************************************************************************/
50 /* First free all blocks in the MemList */
51 for(i
=0;i
<entry
->ml_NumEntries
;i
++)
52 FreeMem(entry
->ml_ME
[i
].me_Addr
,entry
->ml_ME
[i
].me_Length
);
54 /* Then free the MemList itself */
55 FreeMem(entry
,sizeof(struct MemList
)-sizeof(struct MemEntry
)+
56 sizeof(struct MemEntry
)*entry
->ml_NumEntries
);