---
title: bnns_graph_realloc_fn_t
framework: accelerate
role: symbol
role_heading: Type Alias
path: accelerate/bnns_graph_realloc_fn_t
---

# bnns_graph_realloc_fn_t

The workspace and output allocation function.

## Declaration

```swift
typealias bnns_graph_realloc_fn_t = (UnsafeMutableRawPointer?, Int, UnsafeMutablePointer<UnsafeMutableRawPointer?>, Int, Int) -> Int32
```

## Return Value

Return Value 0 on success, nonzero on failure.

## Discussion

Discussion BNNS may call this function for either an initial allocation, or to resize an existing allocation. Typically, on the first execution of a graph all calls to this function are for allocation. Subsequent calls with the same context are for reallocation. An optimized implementation should track sizes and avoid reallocating if the size is the same or smaller.

## See Also

### Specifying a context’s allocation callbacks

- [BNNSGraphContextSetWorkspaceAllocationCallback(_:_:_:_:_:)](accelerate/bnnsgraphcontextsetworkspaceallocationcallback(_:_:_:_:_:).md)
- [BNNSGraphContextSetOutputAllocationCallback(_:_:_:_:_:)](accelerate/bnnsgraphcontextsetoutputallocationcallback(_:_:_:_:_:).md)
- [bnns_graph_free_all_fn_t](accelerate/bnns_graph_free_all_fn_t.md)
