Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
arax_ptr.c
Go to the documentation of this file.
1#include "arax_ptr.h"
2#include "arax_pipe.h"
3
4int arax_ptr_valid(const void *ptr)
5{
6 arax_pipe_s *pipe = arax_init();
7 void *vp = pipe;
8
9 if (ptr < vp) // Before segment start
10 return 0; // not valid
11
12 vp += pipe->shm_size; // Move to end of segment
13
14 if (ptr < vp) // Before segment end
15 return 1; // valid
16
17 return 0; // Not valid
18}
struct arax_pipe arax_pipe_s
int arax_ptr_valid(const void *ptr)
Definition arax_ptr.c:4
arax_pipe_s * arax_init()
Definition impl.c:132
uint64_t shm_size
Definition arax_pipe.h:28