2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 Desc: Allocate some memory.
8 #include "exec_intern.h"
9 #include <aros/libcall.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
17 AROS_LH2(APTR
, AllocVec
,
20 AROS_LHA(IPTR
, byteSize
, D0
),
21 AROS_LHA(ULONG
, requirements
, D1
),
24 struct ExecBase
*, SysBase
, 114, Exec
)
27 Allocate some memory from the sytem memory pool with the given
28 requirements and without the need to memorize the actual size
32 byteSize - Number of bytes you want to get
33 requirements - Type of memory
36 A pointer to the number of bytes you wanted or NULL if the memory
50 ******************************************************************************/
56 /* Add room for stored size. */
57 byteSize
+=AROS_ALIGN(sizeof(IPTR
));
60 ret
=(UBYTE
*)AllocMem(byteSize
,requirements
);
62 /* If there's not enough memory left return immediately. */
67 *(IPTR
*)ret
=byteSize
;
69 /* return free space */
70 return ret
+AROS_ALIGN(sizeof(IPTR
));