<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/SparseSymbolicFactorOptions/malloc",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@SA@SparseSymbolicFactorOptions@FI@malloc"
  },
  "title" : "malloc"
}
-->

# malloc

The function for allocating any necessary storage.

```
var malloc: (Int) -> UnsafeMutableRawPointer?
```

## Parameters

`size`

The size of space to allocate in bytes.

## Return Value

A pointer to newly allocated memory, or `nil` if allocation fails.

## Discussion

The system frees memory through the [`free`](/documentation/Accelerate/SparseSymbolicFactorOptions/free) callback. If this function pointer is `nil`, the system uses `malloc()`.

---

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)