github.com/256dpi/max-go@v0.7.0/lib/max/ext_sysshmem.h (about) 1 #ifndef _EXT_SYSSHMEM_H_ 2 #define _EXT_SYSSHMEM_H_ 3 4 #include "ext_prefix.h" 5 #include "max_types.h" 6 7 BEGIN_USING_C_LINKAGE 8 9 // sysshmem is a platform independent interface to shared memory 10 11 typedef void *t_sysshmem; 12 13 enum t_sysshmem_flag { 14 SYSSHMEM_FLAGS_READONLY = 0x00000001 15 }; 16 17 t_max_err sysshmem_alloc(t_sysshmem *x, const char *name, long size, long flags); // allocate memory that can be shared 18 t_max_err sysshmem_open(t_sysshmem *x, const char *name, long flags); // open memory allocated elsewhere 19 t_max_err sysshmem_close(t_sysshmem x); // after this call t_sysshmem handle is no longer valid 20 21 unsigned long sysshmem_getsize(t_sysshmem x); // number of bytes in shared memory block 22 void* sysshmem_getptr(t_sysshmem x); // pointer to actual memory 23 24 END_USING_C_LINKAGE 25 26 #endif // #ifndef _EXT_SYSSHMEM_H_