DPDK 25.07.0-rc1
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_memory.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
29 unsigned free_count;
30 unsigned alloc_count;
32};
33
37#define __rte_dealloc_free __rte_dealloc(rte_free, 1)
38
51void
52rte_free(void *ptr);
53
54
73__rte_experimental
74void
76
98void *
99rte_malloc(const char *type, size_t size, unsigned align)
102
126void *
127rte_zmalloc(const char *type, size_t size, unsigned align)
130
154void *
155rte_calloc(const char *type, size_t num, size_t size, unsigned align)
158
179void *
180rte_realloc(void *ptr, size_t size, unsigned int align)
183
206void *
207rte_realloc_socket(void *ptr, size_t size, unsigned int align, int socket)
210
234void *
235rte_malloc_socket(const char *type, size_t size, unsigned align, int socket)
238
264void *
265rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket)
268
294void *
295rte_calloc_socket(const char *type, size_t num, size_t size, unsigned align, int socket)
298
316int
317rte_malloc_validate(const void *ptr, size_t *size);
318
333int
335 struct rte_malloc_socket_stats *socket_stats);
336
376int
377rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len,
378 rte_iova_t iova_addrs[], unsigned int n_pages, size_t page_sz);
379
407int
408rte_malloc_heap_memory_remove(const char *heap_name, void *va_addr, size_t len);
409
431int
432rte_malloc_heap_memory_attach(const char *heap_name, void *va_addr, size_t len);
433
455int
456rte_malloc_heap_memory_detach(const char *heap_name, void *va_addr, size_t len);
457
474int
475rte_malloc_heap_create(const char *heap_name);
476
497int
498rte_malloc_heap_destroy(const char *heap_name);
499
511int
513
526int
528
543void
544rte_malloc_dump_stats(FILE *f, const char *type);
545
555void
557
569rte_malloc_virt2iova(const void *addr);
570
571#ifdef __cplusplus
572}
573#endif
574
575#endif /* _RTE_MALLOC_H_ */
#define __rte_alloc_align(argno)
Definition: rte_common.h:318
uint64_t rte_iova_t
Definition: rte_common.h:770
#define __rte_alloc_size(...)
Definition: rte_common.h:305
#define __rte_malloc
Definition: rte_common.h:328
void * rte_calloc_socket(const char *type, size_t num, size_t size, unsigned align, int socket) __rte_alloc_size(2
void rte_free(void *ptr)
__rte_experimental void rte_free_sensitive(void *ptr)
void * rte_malloc(const char *type, size_t size, unsigned align) __rte_alloc_size(2) __rte_alloc_align(3) __rte_malloc __rte_dealloc_free
int rte_malloc_heap_destroy(const char *heap_name)
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_realloc_socket(void *ptr, size_t size, unsigned int align, int socket) __rte_alloc_size(2) __rte_alloc_align(3) __rte_malloc __rte_dealloc_free
void rte_malloc_dump_stats(FILE *f, const char *type)
void * rte_malloc_socket(const char *type, size_t size, unsigned align, int socket) __rte_alloc_size(2) __rte_alloc_align(3) __rte_malloc __rte_dealloc_free
int rte_malloc_heap_socket_is_external(int socket_id)
void * rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket) __rte_alloc_size(2) __rte_alloc_align(3) __rte_malloc __rte_dealloc_free
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)
#define __rte_dealloc_free
Definition: rte_malloc.h:37
int rte_malloc_heap_create(const char *heap_name)
int rte_malloc_get_socket_stats(int socket, struct rte_malloc_socket_stats *socket_stats)
void rte_malloc_dump_heaps(FILE *f)
void * rte_realloc(void *ptr, size_t size, unsigned int align) __rte_alloc_size(2) __rte_alloc_align(3) __rte_malloc __rte_dealloc_free
void * rte_zmalloc(const char *type, size_t size, unsigned align) __rte_alloc_size(2) __rte_alloc_align(3) __rte_malloc __rte_dealloc_free
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)
int rte_malloc_heap_get_socket(const char *name)