---
title: OSMalloc_Tagalloc
framework: kernel
role: symbol
role_heading: Function
path: kernel/1398437-osmalloc_tagalloc
---

# OSMalloc_Tagalloc

Creates a tag for use with OSMalloc functions.

## Declaration

```occ
OSMallocTag OSMalloc_Tagalloc(const char *name, uint32_t flags);
```

## Parameters

- `name`: The name of the tag to create.
- `flags`: A bitmask that controls allocation behavior; see description.

## Return Value

Return Value An opaque tag to be used with OSMalloc functions for tracking memory usage.

## Discussion

Discussion OSMalloc tags can have arbitrary names of a length up to 63 characters. Calling this function twice with the same name creates two tags, which share that name. flags can be the bitwise OR of the following flags: OSMT_DEFAULT - allocations are wired. This is the 'zero' bitmask value and is overridden by any other flag specified. OSMT_PAGEABLE - allocations of a full page size or greater are pageable; allocations smaller than a page are wired.

## See Also

### Memory

- [OSMalloc](kernel/1398447-osmalloc.md)
- [OSMalloc_Tagfree](kernel/1398439-osmalloc_tagfree.md)
- [OSMalloc_noblock](kernel/1398431-osmalloc_noblock.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)
