<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/bnns_graph_free_all_fn_t",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@T@bnns_graph_free_all_fn_t"
  },
  "title" : "bnns_graph_free_all_fn_t"
}
-->

# bnns_graph_free_all_fn_t

The workspace and output deallocation function.

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

## Return Value

`0` on success, nonzero on failure.

## 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(_:_:_:_:_:)`](/documentation/Accelerate/BNNSGraphContextSetWorkspaceAllocationCallback(_:_:_:_:_:)) and [`BNNSGraphContextSetOutputAllocationCallback(_:_:_:_:_:)`](/documentation/Accelerate/BNNSGraphContextSetOutputAllocationCallback(_:_:_:_:_:)), BNNS calls this function once, during [`BNNSGraphContextDestroy(_:)`](/documentation/Accelerate/BNNSGraphContextDestroy(_:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)