---
title: "CMBlockBufferAssureBlockMemory(_:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmblockbufferassureblockmemory(_:)"
---

# CMBlockBufferAssureBlockMemory(_:)

Assures that the system allocates memory for all memory blocks in a block buffer.

## Declaration

```swift
func CMBlockBufferAssureBlockMemory(_ theBuffer: CMBlockBuffer) -> OSStatus
```

## Parameters

- `theBuffer`: CMBlockBuffer to operate on. Must not be NULL.

## Return Value

Return Value Returns kCMBlockBufferNoErr if successful.

## Discussion

Discussion Traverses the possibly complex CMBlockBuffer, allocating the memory for any constituent memory blocks that are not yet allocated.

## See Also

### Modifying a Block Buffer

- [CMBlockBufferAppendMemoryBlock(_:memoryBlock:length:blockAllocator:customBlockSource:offsetToData:dataLength:flags:)](coremedia/cmblockbufferappendmemoryblock(_:memoryblock:length:blockallocator:customblocksource:offsettodata:datalength:flags:).md)
- [CMBlockBufferAppendBufferReference(_:targetBBuf:offsetToData:dataLength:flags:)](coremedia/cmblockbufferappendbufferreference(_:targetbbuf:offsettodata:datalength:flags:).md)
- [CMBlockBufferAccessDataBytes(_:atOffset:length:temporaryBlock:returnedPointerOut:)](coremedia/cmblockbufferaccessdatabytes(_:atoffset:length:temporaryblock:returnedpointerout:).md)
- [CMBlockBufferCopyDataBytes(_:atOffset:dataLength:destination:)](coremedia/cmblockbuffercopydatabytes(_:atoffset:datalength:destination:).md)
- [CMBlockBufferReplaceDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)](coremedia/cmblockbufferreplacedatabytes(with:blockbuffer:offsetintodestination:datalength:).md)
- [CMBlockBufferFillDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)](coremedia/cmblockbufferfilldatabytes(with:blockbuffer:offsetintodestination:datalength:).md)
