| mi-malloc 1.7/2.0 |

Macros
Typed Macros

Typed allocation macros. More...

## Macros
#define | mi_malloc_tp(tp)
| Allocate a block of type tp. More...
#define | mi_zalloc_tp(tp)
| Allocate a zero-initialized block of type tp. More...
#define | mi_calloc_tp(tp, count)
| Allocate count zero-initialized blocks of type tp. More...
#define | mi_mallocn_tp(tp, count)
| Allocate count blocks of type tp. More...
#define | mi_reallocn_tp(p, tp, count)
| Re-allocate to count blocks of type tp. More...
#define | mi_heap_malloc_tp(hp, tp)
| Allocate a block of type tp in a heap hp. More...
#define | mi_heap_zalloc_tp(hp, tp)
| Allocate a zero-initialized block of type tp in a heap hp. More...
#define | mi_heap_calloc_tp(hp, tp, count)
| Allocate count zero-initialized blocks of type tp in a heap hp. More...
#define | mi_heap_mallocn_tp(hp, tp, count)
| Allocate count blocks of type tp in a heap hp. More...
#define | mi_heap_reallocn_tp(hp, p, tp, count)
| Re-allocate to count blocks of type tp in a heap hp. More...
#define | mi_heap_recalloc_tp(hp, p, tp, count)
| Re-allocate to count zero initialized blocks of type tp in a heap hp. More...

## Detailed Description

Typed allocation macros.

For example:

int* p = mi_malloc_tp(int)
mi_malloc_tp
#define mi_malloc_tp(tp)
Allocate a block of type tp.
Definition: mimalloc-doc.h:692

## Macro Definition Documentation

## ◆ mi_calloc_tp

#define mi_calloc_tp | ( |  | tp,
|  |  | count
| ) |  |

Allocate count zero-initialized blocks of type tp.

## ◆ mi_heap_calloc_tp

#define mi_heap_calloc_tp | ( |  | hp,
|  |  | tp,
|  |  | count
| ) |  |

Allocate count zero-initialized blocks of type tp in a heap hp.

## ◆ mi_heap_malloc_tp

#define mi_heap_malloc_tp | ( |  | hp,
|  |  | tp
| ) |  |

Allocate a block of type tp in a heap hp.

## ◆ mi_heap_mallocn_tp

#define mi_heap_mallocn_tp | ( |  | hp,
|  |  | tp,
|  |  | count
| ) |  |

Allocate count blocks of type tp in a heap hp.

## ◆ mi_heap_reallocn_tp

#define mi_heap_reallocn_tp | ( |  | hp,
|  |  | p,
|  |  | tp,
|  |  | count
| ) |  |

Re-allocate to count blocks of type tp in a heap hp.

## ◆ mi_heap_recalloc_tp

#define mi_heap_recalloc_tp | ( |  | hp,
|  |  | p,
|  |  | tp,
|  |  | count
| ) |  |

Re-allocate to count zero initialized blocks of type tp in a heap hp.

## ◆ mi_heap_zalloc_tp

#define mi_heap_zalloc_tp | ( |  | hp,
|  |  | tp
| ) |  |

Allocate a zero-initialized block of type tp in a heap hp.

## ◆ mi_malloc_tp

#define mi_malloc_tp | ( |  | tp | ) |

Allocate a block of type tp.

Parameters

  tp | The type of the block to allocate.

Returns
  A pointer to an object of type tp, or NULL if out of memory.

Example:

int* p = mi_malloc_tp(int)

See also
  mi_malloc()

## ◆ mi_mallocn_tp

#define mi_mallocn_tp | ( |  | tp,
|  |  | count
| ) |  |

Allocate count blocks of type tp.

## ◆ mi_reallocn_tp

#define mi_reallocn_tp | ( |  | p,
|  |  | tp,
|  |  | count
| ) |  |

Re-allocate to count blocks of type tp.

## ◆ mi_zalloc_tp

#define mi_zalloc_tp | ( |  | tp | ) |

Allocate a zero-initialized block of type tp.