MCPcopy Create free account
hub / github.com/JDAI-CV/DNNLibrary / ASharedMemory_create

Function ASharedMemory_create

dnnlibrary/nnapi_implementation.cc:80–91  ·  view source on GitHub ↗

Add /dev/shm implementation of shared memory for non-Android platforms

Source from the content-addressed store, hash-verified

78#ifndef __ANDROID__
79// Add /dev/shm implementation of shared memory for non-Android platforms
80int ASharedMemory_create(const char* name, size_t size) {
81 int fd = shm_open(name, O_RDWR | O_CREAT, 0644);
82 if (fd < 0) {
83 return fd;
84 }
85 int result = ftruncate(fd, size);
86 if (result < 0) {
87 close(fd);
88 return -1;
89 }
90 return fd;
91}
92#endif // __ANDROID__
93
94#define LOAD_FUNCTION(handle, name) \

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected