schrodomain

## schrodomain schrodomain |

## Synopsis

    typedef             SchroExecDomain;
    struct              SchroMemoryDomain;
    #define             SCHRO_EXEC_DOMAIN_CPU
    #define             SCHRO_EXEC_DOMAIN_CUDA
    #define             SCHRO_EXEC_DOMAIN_OPENGL
    #define             SCHRO_MEMORY_DOMAIN_CPU
    #define             SCHRO_MEMORY_DOMAIN_CUDA
    #define             SCHRO_MEMORY_DOMAIN_OPENGL
    #define             SCHRO_MEMORY_DOMAIN_SLOTS
    #define             SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED
    #define             SCHRO_MEMORY_DOMAIN_SLOT_IN_USE
    void *              schro_memory_domain_alloc           (SchroMemoryDomain *domain,
                                                             int size);
    void *              schro_memory_domain_alloc_2d        (SchroMemoryDomain *domain,
                                                             int depth,
                                                             int width,
                                                             int height);
    void                schro_memory_domain_free            (SchroMemoryDomain *domain);
    void                schro_memory_domain_memfree         (SchroMemoryDomain *domain,
                                                             void *ptr);
    SchroMemoryDomain * schro_memory_domain_new             (void);
    SchroMemoryDomain * schro_memory_domain_new_cuda        (void);
    SchroMemoryDomain * schro_memory_domain_new_local       (void);

## Description

## Details

### SchroExecDomain

    typedef int SchroExecDomain;

### struct SchroMemoryDomain

    struct SchroMemoryDomain {
      SchroMutex * mutex;

      unsigned int flags;

      void *(*alloc) (int size);
      void *(*alloc_2d) (int depth, int width, int height);
      void (*free) (void *ptr, int size);

      struct {
        unsigned int flags;
        void *ptr;
        int size;
        void *priv;
      } slots[SCHRO_MEMORY_DOMAIN_SLOTS];
    };

### SCHRO_EXEC_DOMAIN_CPU

    #define SCHRO_EXEC_DOMAIN_CPU 0x0001

### SCHRO_EXEC_DOMAIN_CUDA

    #define SCHRO_EXEC_DOMAIN_CUDA 0x0002

### SCHRO_EXEC_DOMAIN_OPENGL

    #define SCHRO_EXEC_DOMAIN_OPENGL 0x0003

### SCHRO_MEMORY_DOMAIN_CPU

    #define SCHRO_MEMORY_DOMAIN_CPU 0x0001

### SCHRO_MEMORY_DOMAIN_CUDA

    #define SCHRO_MEMORY_DOMAIN_CUDA 0x0002

### SCHRO_MEMORY_DOMAIN_OPENGL

    #define SCHRO_MEMORY_DOMAIN_OPENGL 0x0004

### SCHRO_MEMORY_DOMAIN_SLOTS

    #define SCHRO_MEMORY_DOMAIN_SLOTS 1000

### SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED

    #define SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED 0x0001

### SCHRO_MEMORY_DOMAIN_SLOT_IN_USE

    #define SCHRO_MEMORY_DOMAIN_SLOT_IN_USE 0x0002

### schro_memory_domain_alloc ()

    void *              schro_memory_domain_alloc           (SchroMemoryDomain *domain,
                                                             int size);

### schro_memory_domain_alloc_2d ()

    void *              schro_memory_domain_alloc_2d        (SchroMemoryDomain *domain,
                                                             int depth,
                                                             int width,
                                                             int height);

### schro_memory_domain_free ()

    void                schro_memory_domain_free            (SchroMemoryDomain *domain);

### schro_memory_domain_memfree ()

    void                schro_memory_domain_memfree         (SchroMemoryDomain *domain,
                                                             void *ptr);

### schro_memory_domain_new ()

    SchroMemoryDomain * schro_memory_domain_new             (void);

### schro_memory_domain_new_cuda ()

    SchroMemoryDomain * schro_memory_domain_new_cuda        (void);

### schro_memory_domain_new_local ()

    SchroMemoryDomain * schro_memory_domain_new_local       (void);