home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / exec / freevec.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-09  |  1.8 KB  |  85 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: freevec.c,v 1.9 1997/01/01 03:46:10 ldp Exp $
  4.     $Log: freevec.c,v $
  5.     Revision 1.9  1997/01/01 03:46:10  ldp
  6.     Committed Amiga native (support) code
  7.  
  8.     Changed clib to proto
  9.  
  10.     Revision 1.8  1996/12/10 13:51:46  aros
  11.     Moved all #include's in the first column so makedepend can see it.
  12.  
  13.     Revision 1.7  1996/10/24 15:50:50  aros
  14.     Use the official AROS macros over the __AROS versions.
  15.  
  16.     Revision 1.6  1996/10/23 14:13:44  aros
  17.     Use AROS_ALIGN() to align pointers
  18.  
  19.     Revision 1.5  1996/10/19 17:07:26  aros
  20.     Include <aros/machine.h> instead of machine.h
  21.  
  22.     Revision 1.4  1996/08/13 13:56:03  digulla
  23.     Replaced AROS_LA by AROS_LHA
  24.     Replaced some AROS_LH*I by AROS_LH*
  25.     Sorted and added includes
  26.  
  27.     Revision 1.3  1996/08/01 17:41:12  digulla
  28.     Added standard header for all files
  29.  
  30.     Desc:
  31.     Lang: english
  32. */
  33. #include "exec_intern.h"
  34. #include <aros/libcall.h>
  35. #include <aros/machine.h>
  36. #include "memory.h"
  37. #include <proto/exec.h>
  38.  
  39. /*****************************************************************************
  40.  
  41.     NAME */
  42.  
  43.     AROS_LH1(void, FreeVec,
  44.  
  45. /*  SYNOPSIS */
  46.     AROS_LHA(APTR, memoryBlock, A1),
  47.  
  48. /*  LOCATION */
  49.     struct ExecBase *, SysBase, 115, Exec)
  50.  
  51. /*  FUNCTION
  52.     Free some memory allocated with allocvec.
  53.  
  54.     INPUTS
  55.     memoryBlock - The memory to be freed. It is safe to free a NULL pointer.
  56.  
  57.     RESULT
  58.  
  59.     NOTES
  60.  
  61.     EXAMPLE
  62.  
  63.     BUGS
  64.  
  65.     SEE ALSO
  66.     AllocVec()
  67.  
  68.     INTERNALS
  69.  
  70.     HISTORY
  71.     15-10-95    created by m. fleischer
  72.  
  73. ******************************************************************************/
  74. {
  75.     AROS_LIBFUNC_INIT
  76.  
  77.     /* If there's nothing to free do nothing. */
  78.     if (memoryBlock != NULL)
  79.     {
  80.     *(UBYTE **)&memoryBlock -= AROS_ALIGN(sizeof(ULONG));
  81.     FreeMem (memoryBlock, *((ULONG *)memoryBlock));
  82.     }
  83.     AROS_LIBFUNC_EXIT
  84. } /* FreeVec */
  85.