Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
rw_alloc.h
Go to the documentation of this file.
1
27#ifndef RW_ALLOC_H_INCLUDED
28#define RW_ALLOC_H_INCLUDED
29
30
31#include <rw_testdefs.h> // for test config macros
32
33enum {
35 RW_PROT_READ = 1 << 0,
36 RW_PROT_WRITE = 1 << 1,
38 RW_PROT_BELOW = 1 << 3
39};
40
41// if flags == -1 memory will be allocated by malloc();
42// if flags != -1 memory will be allocated by system call and
43// additional guard page with PAGE_NOACCESS protection will be allocated
44// if RW_PROT_BELOW & flags != 0 then guard page will be located right
45// before the user data, otherwise - right after the user data
46// if RWSTD_ALLOC_FLAGS environment variable is defined and != 0
47// and flags == -1, then rw_alloc will use value of RWSTD_ALLOC_FLAGS
48// instead of flags variable
49_TEST_EXPORT void*
50rw_alloc(_RWSTD_SIZE_T, int /*flags*/ = -1);
51
52// free the memory block, allocated by rw_alloc()
53_TEST_EXPORT void
54rw_free(void*);
55
56#endif // RW_ALLOC_H_INCLUDED
@ RW_PROT_READ
Definition rw_alloc.h:35
@ RW_PROT_NONE
Definition rw_alloc.h:34
@ RW_PROT_WRITE
Definition rw_alloc.h:36
@ RW_PROT_RDWR
Definition rw_alloc.h:37
@ RW_PROT_BELOW
Definition rw_alloc.h:38
_TEST_EXPORT void rw_free(void *)
Definition alloc.cpp:621
_TEST_EXPORT void * rw_alloc(_RWSTD_SIZE_T, int=-1)
#define _TEST_EXPORT
Definition rw_testdefs.h:55