DPDK 21.11.9
rte_malloc.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2019 Intel Corporation
3 */
4
5#ifndef _RTE_MALLOC_H_
6#define _RTE_MALLOC_H_
7
14#include <stdio.h>
15#include <stddef.h>
16#include <rte_compat.h>
17#include <rte_memory.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
30 unsigned free_count;
31 unsigned alloc_count;
33};
34
56void *
57rte_malloc(const char *type, size_t size, unsigned align)
59
83void *
84rte_zmalloc(const char *type, size_t size, unsigned align)
86
110void *
111rte_calloc(const char *type, size_t num, size_t size, unsigned align)
112 __rte_alloc_size(2, 3);
113
134void *
135rte_realloc(void *ptr, size_t size, unsigned int align)
137
160void *
161rte_realloc_socket(void *ptr, size_t size, unsigned int align, int socket)
163
187void *
188rte_malloc_socket(const char *type, size_t size, unsigned align, int socket)
190
216void *
217rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket)
219
245void *
246rte_calloc_socket(const char *type, size_t num, size_t size, unsigned align, int socket)
247 __rte_alloc_size(2, 3);
248
261void
262rte_free(void *ptr);
263
281int
282rte_malloc_validate(const void *ptr, size_t *size);
283
298int
300 struct rte_malloc_socket_stats *socket_stats);
301
341int
342rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len,
343 rte_iova_t iova_addrs[], unsigned int n_pages, size_t page_sz);
344
372int
373rte_malloc_heap_memory_remove(const char *heap_name, void *va_addr, size_t len);
374
396int
397rte_malloc_heap_memory_attach(const char *heap_name, void *va_addr, size_t len);
398
420int
421rte_malloc_heap_memory_detach(const char *heap_name, void *va_addr, size_t len);
422
439int
440rte_malloc_heap_create(const char *heap_name);
441
462int
463rte_malloc_heap_destroy(const char *heap_name);
464
476int
478
491int
493
509void
510rte_malloc_dump_stats(FILE *f, const char *type);
511
521void
523
537__rte_deprecated
538int
539rte_malloc_set_limit(const char *type, size_t max);
540
552rte_malloc_virt2iova(const void *addr);
553
554#ifdef __cplusplus
555}
556#endif
557
558#endif /* _RTE_MALLOC_H_ */
uint64_t rte_iova_t
Definition: rte_common.h:438
#define __rte_alloc_size(...)
Definition: rte_common.h:164
void * rte_calloc_socket(const char *type, size_t num, size_t size, unsigned align, int socket) __rte_alloc_size(2
void * rte_zmalloc(const char *type, size_t size, unsigned align) __rte_alloc_size(2)
int rte_malloc_heap_destroy(const char *heap_name)
void void rte_free(void *ptr)
int rte_malloc_heap_memory_attach(const char *heap_name, void *va_addr, size_t len)
int rte_malloc_validate(const void *ptr, size_t *size)
void * rte_calloc(const char *type, size_t num, size_t size, unsigned align) __rte_alloc_size(2
void * rte_malloc(const char *type, size_t size, unsigned align) __rte_alloc_size(2)
void void * rte_realloc(void *ptr, size_t size, unsigned int align) __rte_alloc_size(2)
void rte_malloc_dump_stats(FILE *f, const char *type)
int rte_malloc_heap_socket_is_external(int socket_id)
void * rte_realloc_socket(void *ptr, size_t size, unsigned int align, int socket) __rte_alloc_size(2)
__rte_deprecated int rte_malloc_set_limit(const char *type, size_t max)
int rte_malloc_heap_memory_detach(const char *heap_name, void *va_addr, size_t len)
rte_iova_t rte_malloc_virt2iova(const void *addr)
int rte_malloc_heap_memory_remove(const char *heap_name, void *va_addr, size_t len)
int rte_malloc_heap_create(const char *heap_name)
void * rte_malloc_socket(const char *type, size_t size, unsigned align, int socket) __rte_alloc_size(2)
int rte_malloc_get_socket_stats(int socket, struct rte_malloc_socket_stats *socket_stats)
void rte_malloc_dump_heaps(FILE *f)
int rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len, rte_iova_t iova_addrs[], unsigned int n_pages, size_t page_sz)
void * rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket) __rte_alloc_size(2)
int rte_malloc_heap_get_socket(const char *name)