2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Free memory allocated with AllocEntry().
8 #include <aros/libcall.h>
9 #include <exec/memory.h>
10 #include <proto/exec.h>
12 #include "exec_debug.h"
14 #ifndef DEBUG_FreeEntry
15 # define DEBUG_FreeEntry 0
22 #include "exec_intern.h"
24 /*****************************************************************************
28 AROS_LH1(void, FreeEntry
,
31 AROS_LHA(struct MemList
*, entry
,A0
),
34 struct ExecBase
*, SysBase
, 38, Exec
)
38 Free some memory allocated with AllocEntry().
41 entry - The MemList you got from AllocEntry().
56 ******************************************************************************/
61 /* First free all blocks in the MemList */
62 for(i
=0;i
<entry
->ml_NumEntries
;i
++)
64 D(bug("[FreeEntry] Freeing size %d at 0x%p\n", entry
->ml_ME
[i
].me_Length
,entry
->ml_ME
[i
].me_Addr
));
65 FreeMem(entry
->ml_ME
[i
].me_Addr
,entry
->ml_ME
[i
].me_Length
);
68 /* Then free the MemList itself */
69 FreeMem(entry
,sizeof(struct MemList
)-sizeof(struct MemEntry
)+
70 sizeof(struct MemEntry
)*entry
->ml_NumEntries
);