acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
shared_memory.h
1// From acme/operating_system/windows/shared_memory.h by
2// camilo on 2026-05-19 17:41 <3ThomasBorregaardSørensen!!
3#pragma once
4
5
6#include "acme/operating_system/shared_memory.h"
7#include "acme/_operating_system.h"
8
9
10namespace posix
11{
12
13 class CLASS_DECL_ACME shared_memory :
14 virtual public ::shared_memory
15 {
16 public:
17
18
19 //unsigned int m_nAllocFlags;
20 //HGLOBAL m_hGlobalMemory;
21 memsize m_memsize;
22 //HANDLE m_hToMap;
23 int m_fd;
24 void *m_p;
25#if defined(__ANDROID__)
26 string m_strName;
27#endif
28
29 //bool m_bAllowGrow;
30
31
32 //shared_memory(const memory_base & memory);
33 //shared_memory(memory_container * pmsc = nullptr, double dAllocationRateUp = 4096, unsigned int nAllocFlags = 0);
34 //shared_memory(memory_container * pmsc, const void * pMemory, memsize dwSize);
35 //shared_memory(const void *, memsize iCount);
36 shared_memory();
37 ~shared_memory() override;
38
39
40 //virtual void SetHandle(HGLOBAL hGlobalMemory, bool bAllowGrow = true);
41
42 void CreateSharedMemory(const_char_pointer name, memsize size) override;
43 void OpenSharedMemory(const_char_pointer name, memsize size) override;
44
45 //virtual unsigned char * impl_alloc(memsize nBytes) override;
46 //virtual unsigned char * impl_realloc(void * pdata, memsize nBytes) override;
47 //virtual void impl_free(unsigned char * pMem) override;
48
49 void Close() override;
50
51 //unsigned char * detach_shared_memory(HGLOBAL & hglobal);
52 //unsigned char * detach(HGLOBAL & hglobal);
53 // virtual bool allocate_internal(memsize dwNewLength);
54
55 protected:
56
57 //virtual bool _createFile(const char *name, memsize size);
58 //virtual void _mapViewOfFile();
59 //virtual void _setAllAccess(HANDLE handle);
60
61 //virtual ::matter * clone() override;
62
63 };
64
65
66} // namespace posix
67
68