2 Copyright � 1995-2012, The AROS Development Team. All rights reserved.
5 Desc: Free memory allocated by AllocPooled().
9 #include <aros/libcall.h>
10 #include <exec/memory.h>
11 #include <exec/memheaderext.h>
12 #include <proto/exec.h>
14 #include "exec_intern.h"
15 #include "exec_util.h"
18 /*****************************************************************************
22 AROS_LH3(void,FreePooled
,
25 AROS_LHA(APTR
, poolHeader
,A0
),
26 AROS_LHA(APTR
, memory
, A1
),
27 AROS_LHA(IPTR
, memSize
, D0
),
30 struct ExecBase
*, SysBase
, 119, Exec
)
33 Free memory allocated out of a private memory pool.
36 poolHeader - Handle of the memory pool
37 memory - Pointer to the memory
38 memSize - Size of the memory chunk
49 CreatePool(), DeletePool(), AllocPooled()
52 In AROS memory allocated from pool remembers where it came from.
53 Because of this poolHeader is effectively ignored and is present
54 only for compatibility reasons. However, do not rely on this! For
55 other operating systems of Amiga(tm) family this is not true!
57 ******************************************************************************/
61 struct MemHeaderExt
*mhe
= (struct MemHeaderExt
*)poolHeader
;
63 if (mhe
->mhe_MemHeader
.mh_Attributes
& MEMF_MANAGED
)
66 mhe
->mhe_Free(mhe
, memory
, memSize
);
70 struct TraceLocation tp
= CURRENT_LOCATION("FreePooled");
72 InternalFreePooled(memory
, memSize
, &tp
, SysBase
);