2 Copyright � 1995-2013, 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 that was allocated out of a private memory pool by
37 poolHeader - Handle of the memory pool
38 memory - Pointer to the memory
39 memSize - Size of the memory chunk
50 CreatePool(), DeletePool(), AllocPooled()
54 ******************************************************************************/
58 struct MemHeaderExt
*mhe
= (struct MemHeaderExt
*)poolHeader
;
60 /* If there is nothing to free do nothing. */
61 if(!memSize
|| !memory
)
64 if (IsManagedMem(mhe
))
67 mhe
->mhe_Free(mhe
, memory
, memSize
);
71 struct TraceLocation tp
= CURRENT_LOCATION("FreePooled");
73 InternalFreePooled(poolHeader
, memory
, memSize
, &tp
, SysBase
);