Welcome Latvia to Euro
[AROS.git] / rom / exec / freepooled.c
blob1e291f15557d57621884329e2bf546c5d60b1067
1 /*
2 Copyright � 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Free memory allocated by AllocPooled().
6 Lang: english
7 */
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"
16 #include "memory.h"
18 /*****************************************************************************
20 NAME */
22 AROS_LH3(void,FreePooled,
24 /* SYNOPSIS */
25 AROS_LHA(APTR, poolHeader,A0),
26 AROS_LHA(APTR, memory, A1),
27 AROS_LHA(IPTR, memSize, D0),
29 /* LOCATION */
30 struct ExecBase *, SysBase, 119, Exec)
32 /* FUNCTION
33 Free memory that was allocated out of a private memory pool by
34 AllocPooled().
36 INPUTS
37 poolHeader - Handle of the memory pool
38 memory - Pointer to the memory
39 memSize - Size of the memory chunk
41 RESULT
43 NOTES
45 EXAMPLE
47 BUGS
49 SEE ALSO
50 CreatePool(), DeletePool(), AllocPooled()
52 INTERNALS
54 ******************************************************************************/
56 AROS_LIBFUNC_INIT
58 struct MemHeaderExt *mhe = (struct MemHeaderExt *)poolHeader;
60 if (IsManagedMem(mhe))
62 if (mhe->mhe_Free)
63 mhe->mhe_Free(mhe, memory, memSize);
65 else
67 struct TraceLocation tp = CURRENT_LOCATION("FreePooled");
69 InternalFreePooled(poolHeader, memory, memSize, &tp, SysBase);
72 AROS_LIBFUNC_EXIT
73 } /* FreePooled */