home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / il / ilStackAlloc.z / ilStackAlloc
Encoding:
Text File  |  2002-10-03  |  2.2 KB  |  67 lines

  1.  
  2.  
  3.  
  4. iiiillllSSSSttttaaaacccckkkkAAAAlllllllloooocccc((((3333))))    IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll    iiiillllSSSSttttaaaacccckkkkAAAAlllllllloooocccc((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiillllSSSSttttaaaacccckkkkAAAAlllllllloooocccc - stack space allocation
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           #include <il/ilStackAlloc.h>
  13.  
  14.           void* ilStackAlloc(unsigned int size);
  15.  
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      iiiillllSSSSttttaaaacccckkkkAAAAlllllllloooocccc() returns a pointer to size bytes of uninitialized local
  19.      stack space. Since the space is allocated using a built-in compiler
  20.      function, the allocation is quite fast. If zero is passed as size, alloca
  21.      returns a valid pointer (unlike some versions of malloc, which consider a
  22.      zero size to be an error).
  23.  
  24.      The #include <il/ilStackAlloc.h> is required.
  25.  
  26.      Space allocated when a function calls iiiillllSSSSttttaaaacccckkkkAAAAlllllllloooocccc() is freed
  27.      automatically when that function returns.
  28.  
  29.      It is an error to call ffffrrrreeeeeeee() with a pointer returned by iiiillllSSSSttttaaaacccckkkkAAAAlllllllloooocccc().
  30.  
  31. CCCCAAAAVVVVEEEEAAAATTTTSSSS
  32.      Do not call ilStackAlloc as an argument to another function, as in
  33.      foo(ilStackAlloc(20));. Instead use, for example, cp = ilStackAlloc(20);
  34.      foo(cp);.
  35.  
  36.      Assign the value returned by ilStackAlloc to a simple variable. For
  37.      example, mylist[i] = ilStackAlloc(12); will not work. Instead, use cp =
  38.      ilStackAlloc(12); mylist[i] = cp;.
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.