---
title: OSMalloc_noblock
framework: kernel
role: symbol
role_heading: Function
path: kernel/1398431-osmalloc_noblock
---

# OSMalloc_noblock

Allocates a block of memory associated with a given OSMallocTag, returning NULL if it would block.

## Declaration

```occ
void * OSMalloc_noblock(uint32_t size, OSMallocTag tag);
```

## Parameters

- `size`: The size of the memory block to allocate.
- `tag`: The doc://com.apple.documentation/documentation/kernel/osmalloctag under which to allocate the memory.

## Return Value

Return Value A pointer to the memory on success, NULL on failure or if allocation would block.

## Discussion

Discussion If tag was created with the OSMT_PAGEABLE attribute and size is a full page or larger, the allocated memory is pageable; otherwise it is wired. This function is guaranteed not to block.

## See Also

### Memory

- [OSMalloc](kernel/1398447-osmalloc.md)
- [OSMalloc_Tagalloc](kernel/1398437-osmalloc_tagalloc.md)
- [OSMalloc_Tagfree](kernel/1398439-osmalloc_tagfree.md)
- [OSMalloc_nowait](kernel/1398445-osmalloc_nowait.md)
- [OSFree](kernel/1398441-osfree.md)
- [bzero](kernel/1579350-bzero.md)
- [bzero_phys](kernel/1593364-bzero_phys.md)
