2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Original version from libnix
7 #define AROS_LIBREQ(base,ver) /* We test for versions manually */
10 #include <proto/exec.h>
12 /*****************************************************************************
15 #include <proto/alib.h>
41 06.12.96 digulla Created after original from libnix
43 ******************************************************************************/
45 # define poolHeader ((POOL *)pool)
46 if (SysBase
->LibNode
.lib_Version
>= 39)
48 FreePooled (poolHeader
, memory
, memSize
);
52 if (poolHeader
!=NULL
&& memory
!=NULL
)
55 * puddle
= (ULONG
*)((struct MinNode
*)memory
- 1) - 1;
57 if (poolHeader
->ThreshSize
>memSize
)
59 struct MemHeader
* a
= (struct MemHeader
*)&poolHeader
->PuddleList
.mlh_Head
;
63 a
= (struct MemHeader
*)a
->mh_Node
.ln_Succ
;
65 if (a
->mh_Node
.ln_Succ
== NULL
)
68 if (a
->mh_Node
.ln_Type
&& memory
>= a
->mh_Lower
69 && memory
< a
->mh_Upper
74 Deallocate (a
, memory
, memSize
);
76 if (a
->mh_Free
!= poolHeader
->PuddleSize
)
79 puddle
= (ULONG
*)&a
->mh_Node
;
82 Remove ((struct Node
*)puddle
);
85 FreeMem (puddle
, size
);