## AgsVector256Manager

AgsVector256Manager — Singleton pattern to organize prefaulted vector memory

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | AGS_VECTOR_ARR()
#define | AGS_VECTOR_256_MANAGER_GET_OBJ_MUTEX()
AgsVectorArr * | ags_vector_arr_alloc ()
void | ags_vector_arr_free ()
void | ags_vector_256_manager_reserve_all ()
AgsVectorArr * | ags_vector_256_manager_try_acquire ()
gboolean | ags_vector_256_manager_try_acquire_dual ()
gboolean | ags_vector_256_manager_try_acquire_triple ()
void | ags_vector_256_manager_release ()
AgsVector256Manager * | ags_vector_256_manager_get_instance ()
AgsVector256Manager * | ags_vector_256_manager_new ()

## Types and Values

#define | AGS_VECTOR_256_MANAGER_DEFAULT_VECTOR_COUNT
enum | AgsVector256Types
struct | AgsVectorArr
struct | AgsVectorMemS8
struct | AgsVectorMemS16
struct | AgsVectorMemS32
struct | AgsVectorMemS64
struct | AgsVectorMemFloat
struct | AgsVectorMemDouble

## Includes

    #include <ags/plugin/ags_vector_256_manager.h>

## Description

The AgsVector256Manager contains prefaulted memory for vector types.

## Functions

### AGS_VECTOR_ARR()

    #define AGS_VECTOR_ARR(ptr) ((AgsVectorArr*)(ptr))

### AGS_VECTOR_256_MANAGER_GET_OBJ_MUTEX()

    #define AGS_VECTOR_256_MANAGER_GET_OBJ_MUTEX(obj) (&(((AgsVector256Manager *) obj)->obj_mutex))

### ags_vector_arr_alloc ()

    AgsVectorArr *
    ags_vector_arr_alloc (AgsVector256Types vector_type);

Allocate vector array of `vector_type` .

#### Parameters

vector_type | the AgsVector256Types |

#### Returns

the newly allocated vector.

[transfer full]

Since: 7.0.0

### ags_vector_arr_free ()

    void
    ags_vector_arr_free (AgsVectorArr *vector_arr);

Free `vector_arr` .

#### Parameters

vector_arr | the AgsVectorArr. | [transfer full]

Since: 7.0.0

### ags_vector_256_manager_reserve_all ()

    void
    ags_vector_256_manager_reserve_all (AgsVector256Manager *vector_256_manager);

Reserve all vector types.

#### Parameters

vector_256_manager | the AgsVector256Manager |

Since: 7.0.0

### ags_vector_256_manager_try_acquire ()

    AgsVectorArr *
    ags_vector_256_manager_try_acquire (AgsVector256Manager *vector_256_manager,
                                        AgsVector256Types vector_type);

Try acquire vector of `vector_type` and lock it.

#### Parameters

vector_256_manager | the AgsVector256Manager |
vector_type | the vector type |

#### Returns

the vector array or `NULL` if none is available yet.

[transfer none]

Since: 7.0.0

### ags_vector_256_manager_try_acquire_dual ()

    gboolean
    ags_vector_256_manager_try_acquire_dual
                                   (AgsVector256Manager *vector_256_manager,
                                    AgsVector256Types vector_type_a,
                                    AgsVector256Types vector_type_b,
                                    AgsVectorArr **vector_arr_a,
                                    AgsVectorArr **vector_arr_b);

Try acquire 2 vectors of vector type and lock it.

#### Parameters

vector_256_manager | the AgsVector256Manager |
vector_type_a | the first vector type |
vector_type_b | the second vector type |
vector_arr_a | the vector array or `NULL` if none is available yet. | [transfer none][out]
vector_arr_b | the vector array or `NULL` if none is available yet. | [transfer none][out]

#### Returns

`TRUE` on success, otherwise `FALSE`

Since: 7.0.0

### ags_vector_256_manager_try_acquire_triple ()

    gboolean
    ags_vector_256_manager_try_acquire_triple
                                   (AgsVector256Manager *vector_256_manager,
                                    AgsVector256Types vector_type_a,
                                    AgsVector256Types vector_type_b,
                                    AgsVector256Types vector_type_c,
                                    AgsVectorArr **vector_arr_a,
                                    AgsVectorArr **vector_arr_b,
                                    AgsVectorArr **vector_arr_c);

Try acquire 3 vectors of vector type and lock it.

#### Parameters

vector_256_manager | the AgsVector256Manager |
vector_type_a | the first vector type |
vector_type_b | the second vector type |
vector_type_c | the third vector type |
vector_arr_a | the vector array or `NULL` if none is available yet. | [transfer none][out]
vector_arr_b | the vector array or `NULL` if none is available yet. | [transfer none][out]
vector_arr_c | the vector array or `NULL` if none is available yet. | [transfer none][out]

#### Returns

`TRUE` on success, otherwise `FALSE`

Since: 7.0.0

### ags_vector_256_manager_release ()

    void
    ags_vector_256_manager_release (AgsVector256Manager *vector_256_manager,
                                    AgsVectorArr *vector_arr);

Release `vector_arr` .

#### Parameters

vector_256_manager | the AgsVector256Manager |
vector_arr | the AgsVectorArr |

Since: 7.0.0

### ags_vector_256_manager_get_instance ()

    AgsVector256Manager *
    ags_vector_256_manager_get_instance ();

Get instance.

#### Returns

the AgsVector256Manager.

[transfer none]

Since: 7.0.0

### ags_vector_256_manager_new ()

    AgsVector256Manager *
    ags_vector_256_manager_new ();

Create a new instance of AgsVector256Manager

#### Returns

the new AgsVector256Manager

Since: 7.0.0

## Types and Values

### AGS_VECTOR_256_MANAGER_DEFAULT_VECTOR_COUNT

    #define AGS_VECTOR_256_MANAGER_DEFAULT_VECTOR_COUNT (96)

### enum AgsVector256Types

#### Members

AGS_VECTOR_256_SIGNED_8_BIT |  |
AGS_VECTOR_256_SIGNED_16_BIT |  |
AGS_VECTOR_256_SIGNED_32_BIT |  |
AGS_VECTOR_256_SIGNED_64_BIT |  |
AGS_VECTOR_256_FLOAT |  |
AGS_VECTOR_256_DOUBLE |  |

### struct AgsVectorArr

    struct AgsVectorArr {
      AgsVector256Types vector_type;

      gboolean locked;

      union{
        AgsVectorMemS8 *vec_s8;
        AgsVectorMemS16 *vec_s16;
        AgsVectorMemS32 *vec_s32;
        AgsVectorMemS64 *vec_s64;
        AgsVectorMemFloat *vec_float;
        AgsVectorMemDouble *vec_double;
      }vector;
    };

### struct AgsVectorMemS8

    struct AgsVectorMemS8 {
      ags_v8s8 mem_s8[32];
    };

### struct AgsVectorMemS16

    struct AgsVectorMemS16 {
      ags_v8s16 mem_s16[32];
    };

### struct AgsVectorMemS32

    struct AgsVectorMemS32 {
      ags_v8s32 mem_s32[32];
    };

### struct AgsVectorMemS64

    struct AgsVectorMemS64 {
      ags_v8s64 mem_s64[32];
    };

### struct AgsVectorMemFloat

    struct AgsVectorMemFloat {
      ags_v8float mem_float[32];
    };

### struct AgsVectorMemDouble

    struct AgsVectorMemDouble {
      ags_v8double mem_double[32];
    };