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

# bnns_graph_free_all_fn_t

The workspace and output deallocation function.

## Declaration

```swift
typealias bnns_graph_free_all_fn_t = (UnsafeMutableRawPointer?, Int) -> Void
```

## Return Value

Return Value 0 on success, nonzero on failure.

## Discussion

Discussion BNNS calls this function on the destruction of a graph context and should free all memory associated to the user_memory_context. If you’ve supplied the same user_memory_context to both BNNSGraphContextSetWorkspaceAllocationCallback(_:_:_:_:_:) and BNNSGraphContextSetOutputAllocationCallback(_:_:_:_:_:), BNNS calls this function once, during BNNSGraphContextDestroy(_:).

## See Also

### Specifying a context’s allocation callbacks

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