home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / alib / libcreatepool.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  1.1 KB  |  69 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     Original version from libnix
  4.     $Id: libcreatepool.c,v 1.2 1997/01/27 00:16:37 ldp Exp $
  5.  
  6.     Desc:
  7.     Lang: english
  8. */
  9. #define AROS_ALMOST_COMPATIBLE
  10. #include "pool.h"
  11.  
  12. /*****************************************************************************
  13.  
  14.     NAME */
  15. #include <proto/aros.h>
  16.  
  17.     APTR LibCreatePool (
  18.  
  19. /*  SYNOPSIS */
  20.     ULONG requirements,
  21.     ULONG puddleSize,
  22.     ULONG threshSize)
  23.  
  24. /*  FUNCTION
  25.  
  26.     INPUTS
  27.  
  28.     RESULT
  29.  
  30.     NOTES
  31.  
  32.     EXAMPLE
  33.  
  34.     BUGS
  35.  
  36.     SEE ALSO
  37.  
  38.     INTERNALS
  39.  
  40.     HISTORY
  41.     06.12.96 digulla Created after original from libnix
  42.  
  43. ******************************************************************************/
  44. {
  45.     if (SysBase->LibNode.lib_Version >= 39)
  46.     return (CreatePool (requirements, puddleSize, threshSize));
  47.  
  48.     {
  49.     POOL * pool = NULL;
  50.  
  51.     if (threshSize <= puddleSize)
  52.     {
  53.         if ((pool = (POOL *)AllocMem (sizeof (POOL), MEMF_ANY)) != NULL)
  54.         {
  55.         NEWLIST (&pool->PuddleList);
  56.  
  57.         puddleSize = ((puddleSize + 7) & ~7);
  58.  
  59.         pool->MemoryFlags = requirements;
  60.         pool->PuddleSize  = puddleSize;
  61.         pool->ThreshSize  = threshSize;
  62.         }
  63.     }
  64.  
  65.     return (APTR)pool;
  66.     }
  67. } /* LibCreatePool */
  68.  
  69.