home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / mem / poolgetsize.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-05-12  |  403 b   |  25 lines

  1.  
  2. #include "tek/mem.h"
  3.  
  4. /* 
  5. **    TEKlib
  6. **    (C) 2001 TEK neoscientists
  7. **    all rights reserved.
  8. **
  9. **    TUINT TPoolGetSize(TAPTR mp, TAPTR mem)
  10. **
  11. **    get size of an allocation from a pool.
  12. **
  13. */
  14.  
  15. TUINT TPoolGetSize(TAPTR mp, TAPTR mem)
  16. {
  17.     if (mp && mem)
  18.     {
  19.         TPOOLNODE **mem2 = (TPOOLNODE **) mem;
  20.         TPOOLNODE *pn = *(--mem2);
  21.         return TStaticGetSize(&pn->memhead, mem2) - sizeof(TPOOLNODE *);
  22.     }
  23.     return 0;
  24. }
  25.