FreePooled(poolHeader,memory,memSize)
      
    void FreePooled(APTR,APTR,ULONG);
    
 
  
    Deallocates memory allocated by 
AllocPooled().  The size of the allocation *MUST* match the size given to 
AllocPooled(). The reason the pool functions do not track individual allocation sizes is because many of the uses of pools have small allocation sizes and the tracking of the size would be a large overhead.
    Only memory allocated by 
AllocPooled() may be freed with this function!
    Doing a 
DeletePool() on the pool will free all of the puddles and thus all of the allocations done with 
AllocPooled() in that pool.  (No need to FreePooled() each allocation)
  
    Memory allocation and deallocation as well as querying how much memory is available requires a Task or, by extension, a Process. None of the exec kernel memory management operations is safe to call from interrupt code!
    Both 
AllocPooled() and FreePooled() require an arbitration mechanism to work correctly. The use of 
ObtainSemaphore()/
ReleaseSemaphore() is recommended.
    If you port source code written for use on AmigaOS 4 to AmigaOS 3.x, be aware that AmigaOS 4 features an integrated arbitration mechanism which can be activated at pool creation time through the ASOPOOL_Protected tag. Likely, there will be no explicit use of the 
ObtainSemaphore() and 
ReleaseSemaphore() functions.
    You should make sure that an arbitration mechanism exists for the ported code or you may experience stability issues and undefined behaviour caused by overlapping memory pool operations.
  
    The pool functions do not protect an individual pool from multiple accesses.  The reason is that in most cases the pools will be used by a single Task.  If your pool is going to be used by more than one Task you must Semaphore protect the pool from having more than one Task trying to allocate within the same pool at the same time.  Warning:  
Forbid() protection *will not work* in the future.  *Do NOT* assume that we will be able to make it work in the future.  FreePooled() may well break a 
Forbid() and as such can only be protected by a semaphore.
    The size of the memory allocation to be freed must match the size used when 
AllocPooled() was called. A mismatch may result in memory corruption or in memory remaining allocated which not even 
DeletePool() can release. THE SIZE OF THE MEMORY ALLOCATION MUST NEVER BE 0, OR INSTANT MEMORY CORRUPTION IS LIKELY TO FOLLOW!
    If the address and allocation size cannot be matched against a puddle or large allocation which is part of the pool, an alert of type AN_BadFreeAddr will be triggered.
    To track sizes yourself, the following code can be used: Assumes a6=ExecBase
    
    ;
    ; Function to do AllocVecPooled(Pool,memSize)
    ;
    AllocVecPooled:
      
        
        tst.l   d0              ; Size must be > 0
        beq.s   avp_fail        ; If zero, failed!
        addq.l  #4,d0           ; Get space for tracking
        bcs.s   avp_overflow    ; Total size too large?
        move.l  d0,-(sp)        ; Save the size
        jsr     _LVOAllocPooled(a6)     ; Call pool...
        move.l  (sp)+,d1        ; Get size back...
        tst.l   d0              ; Check for error
        beq.s   avp_fail        ; If NULL, failed!
        move.l  d0,a0           ; Get pointer...
        move.l  d1,(a0)+        ; Store size
        move.l  a0,d0           ; Get result
        
       
    avp_fail:       rts                     ; return
    avp_overflow:   moveq.l #0,d0
      
    ;
    ; Function to do FreeVecPooled(pool,memory)
    ;
    FreeVecPooled:  move.l  a1,d0           ; Memory must not be NULL
      
        
        beq.s   fvp_ignore
        move.l  -(a1),d0        ; Get size / adjust pointer
        jsr     _LVOFreePooled(a6)
        
       
    fvp_ignore:     rts