2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Original version from libnix
8 #include <proto/exec.h>
10 /*****************************************************************************
13 #include <proto/alib.h>
39 06.12.96 digulla Created after original from libnix
41 ******************************************************************************/
43 # define poolHeader ((POOL *)pool)
44 if (SysBase
->LibNode
.lib_Version
>= 39)
46 FreePooled (poolHeader
, memory
, memSize
);
50 if (poolHeader
!=NULL
&& memory
!=NULL
)
53 * puddle
= (ULONG
*)((struct MinNode
*)memory
- 1) - 1;
55 if (poolHeader
->ThreshSize
>memSize
)
57 struct MemHeader
* a
= (struct MemHeader
*)&poolHeader
->PuddleList
.mlh_Head
;
61 a
= (struct MemHeader
*)a
->mh_Node
.ln_Succ
;
63 if (a
->mh_Node
.ln_Succ
== NULL
)
66 if (a
->mh_Node
.ln_Type
&& memory
>= a
->mh_Lower
67 && memory
< a
->mh_Upper
72 Deallocate (a
, memory
, memSize
);
74 if (a
->mh_Free
!= poolHeader
->PuddleSize
)
77 puddle
= (ULONG
*)&a
->mh_Node
;
80 Remove ((struct Node
*)puddle
);
83 FreeMem (puddle
, size
);