DPDK 22.11.4
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
55void *
56rte_malloc(const char *type, size_t size, unsigned align)
58
82void *
83rte_zmalloc(const char *type, size_t size, unsigned align)
85
109void *
110rte_calloc(const char *type, size_t num, size_t size, unsigned align)
111 __rte_alloc_size(2, 3);
112
133void *
134rte_realloc(void *ptr, size_t size, unsigned int align)
136
159void *
160rte_realloc_socket(void *ptr, size_t size, unsigned int align, int socket)
162
186void *
187rte_malloc_socket(const char *type, size_t size, unsigned align, int socket)
189
215void *
216rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket)
218
244void *
245rte_calloc_socket(const char *type, size_t num, size_t size, unsigned align, int socket)
246 __rte_alloc_size(2, 3);
247
260void
261rte_free(void *ptr);
262
280int
281rte_malloc_validate(const void *ptr, size_t *size);
282
297int
299 struct rte_malloc_socket_stats *socket_stats);
300
340int
341rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len,
342 rte_iova_t iova_addrs[], unsigned int n_pages, size_t page_sz);
343
371int
372rte_malloc_heap_memory_remove(const char *heap_name, void *va_addr, size_t len);
373
395int
396rte_malloc_heap_memory_attach(const char *heap_name, void *va_addr, size_t len);
397
419int
420rte_malloc_heap_memory_detach(const char *heap_name, void *va_addr, size_t len);
421
438int
439rte_malloc_heap_create(const char *heap_name);
440
461int
462rte_malloc_heap_destroy(const char *heap_name);
463
475int
477
490int
492
508void
509rte_malloc_dump_stats(FILE *f, const char *type);
510
520void
522
534rte_malloc_virt2iova(const void *addr);
535
536#ifdef __cplusplus
537}
538#endif
539
540#endif /* _RTE_MALLOC_H_ */
uint64_t rte_iova_t
Definition: rte_common.h:458
#define __rte_alloc_size(...)
Definition: rte_common.h:161
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)
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)