# sp500\_buffer

```cpp
#include <sp500/dsp.h>

struct sp500_buffer
```

A tensor handed to or received from the DSP.

The buffer itself records where its memory lives, so one function signature serves both the zero-copy and the staged path.

- [sp500\_buffer\_alloc()](<https://docs.mobilint.com/regulus/kr/v4.1/api/cpp/dsp-h/#sp500-buffer-alloc>) - shared memory, zero copy, you own it and free it.
- [sp500\_buffer\_wrap()](<https://docs.mobilint.com/regulus/kr/v4.1/api/cpp/dsp-h/#sp500-buffer-wrap>) - your own memory, staged through shared memory.
- [sp500\_buffer\_none()](<https://docs.mobilint.com/regulus/kr/v4.1/api/cpp/dsp-h/#sp500-buffer-none>) - "not used", for optional tensors.

## Attributes

| Member | Description |
| --- | --- |
| [`data`](<#data>) |  |
| [`size`](<#size>) |  |
| [`flags`](<#flags>) |  |

### data

```cpp
void * data
```

host virtual address; NULL means unused

### size

```cpp
uint32_t size
```

size in bytes

### flags

```cpp
uint32_t flags
```

a combination of [SP500\_BUFFER\_SHARED](<https://docs.mobilint.com/regulus/kr/v4.1/api/cpp/dsp-h/#sp500-buffer-shared>)
