Gin
Public Member Functions | Static Public Member Functions | List of all members
SharedMemory Class Reference

Creates a block of shared memory. More...

Public Member Functions

 SharedMemory (const juce::String &name, int size)
 
 ~SharedMemory ()
 
void * getData ()
 
int getSize ()
 

Static Public Member Functions

static void remove (const juce::String &name)
 

Detailed Description

Creates a block of shared memory.

The first one to create the block sets the size otherwise it is ignored. The block may be a different size than requested, especially if it was already created.

On Unix based OSes, if a process using the block crashes, the block will leak. Clean it up later with remove() and it will be deleted when the last process stops using it. (No new processes will be able to attach)

On Windows the memory block will always disappear when the final process closes the handle / crashes.

Constructor & Destructor Documentation

◆ SharedMemory()

SharedMemory::SharedMemory ( const juce::String &  name,
int  size 
)

◆ ~SharedMemory()

SharedMemory::~SharedMemory ( )

Member Function Documentation

◆ remove()

static void SharedMemory::remove ( const juce::String &  name)
static

◆ getData()

void* SharedMemory::getData ( )

◆ getSize()

int SharedMemory::getSize ( )

The documentation for this class was generated from the following file: