2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Allocate memory in a pool.
9 #include <aros/libcall.h>
11 #include "exec_intern.h"
12 #include "exec_util.h"
15 #include "exec_debug.h"
16 #ifndef DEBUG_AllocPooled
17 # define DEBUG_AllocPooled 0
23 #include <aros/debug.h>
28 /*****************************************************************************
31 #include <exec/memory.h>
32 #include <proto/exec.h>
34 AROS_LH2(APTR
, AllocPooled
,
37 AROS_LHA(APTR
, poolHeader
, A0
),
38 AROS_LHA(ULONG
, memSize
, D0
),
41 struct ExecBase
*, SysBase
, 118, Exec
)
44 Allocate memory out of a private memory pool.
47 poolHeader - Handle of the memory pool
48 memSize - Number of bytes you want to get
51 A pointer to the number of bytes you wanted or NULL if the memory
61 CreatePool(), DeletePool(), FreePooled()
65 ******************************************************************************/
69 struct TraceLocation tp
= CURRENT_LOCATION("AllocPooled");
70 struct Pool
*pool
= poolHeader
+ MEMHEADER_TOTAL
;
72 D(bug("AllocPooled 0x%P memsize %u by \"%s\"\n", poolHeader
, memSize
, SysBase
->ThisTask
->tc_Node
.ln_Name
));
74 /* Allocate from the specified pool with flags stored in pool header */
75 return InternalAllocPooled(poolHeader
, memSize
, pool
->Requirements
, &tp
, SysBase
);