git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build: remove deprecated cpuflag macros
[dpdk.git]
/
lib
/
librte_eal
/
common
/
malloc_heap.c
diff --git
a/lib/librte_eal/common/malloc_heap.c
b/lib/librte_eal/common/malloc_heap.c
index
bd50656
..
5a09247
100644
(file)
--- a/
lib/librte_eal/common/malloc_heap.c
+++ b/
lib/librte_eal/common/malloc_heap.c
@@
-642,13
+642,15
@@
malloc_heap_alloc_on_heap_id(const char *type, size_t size,
unsigned int size_flags = flags & ~RTE_MEMZONE_SIZE_HINT_ONLY;
int socket_id;
void *ret;
unsigned int size_flags = flags & ~RTE_MEMZONE_SIZE_HINT_ONLY;
int socket_id;
void *ret;
+ const struct internal_config *internal_conf =
+ eal_get_internal_configuration();
rte_spinlock_lock(&(heap->lock));
align = align == 0 ? 1 : align;
/* for legacy mode, try once and with all flags */
rte_spinlock_lock(&(heap->lock));
align = align == 0 ? 1 : align;
/* for legacy mode, try once and with all flags */
- if (internal_conf
ig.
legacy_mem) {
+ if (internal_conf
->
legacy_mem) {
ret = heap_alloc(heap, type, size, flags, align, bound, contig);
goto alloc_unlock;
}
ret = heap_alloc(heap, type, size, flags, align, bound, contig);
goto alloc_unlock;
}
@@
-832,6
+834,8
@@
malloc_heap_free(struct malloc_elem *elem)
struct rte_memseg_list *msl;
unsigned int i, n_segs, before_space, after_space;
int ret;
struct rte_memseg_list *msl;
unsigned int i, n_segs, before_space, after_space;
int ret;
+ const struct internal_config *internal_conf =
+ eal_get_internal_configuration();
if (!malloc_elem_cookies_ok(elem) || elem->state != ELEM_BUSY)
return -1;
if (!malloc_elem_cookies_ok(elem) || elem->state != ELEM_BUSY)
return -1;
@@
-854,7
+858,7
@@
malloc_heap_free(struct malloc_elem *elem)
/* ...of which we can't avail if we are in legacy mode, or if this is an
* externally allocated segment.
*/
/* ...of which we can't avail if we are in legacy mode, or if this is an
* externally allocated segment.
*/
- if (internal_conf
ig.
legacy_mem || (msl->external > 0))
+ if (internal_conf
->
legacy_mem || (msl->external > 0))
goto free_unlock;
/* check if we can free any memory back to the system */
goto free_unlock;
/* check if we can free any memory back to the system */
@@
-865,7
+869,7
@@
malloc_heap_free(struct malloc_elem *elem)
* we will defer freeing these hugepages until the entire original allocation
* can be freed
*/
* we will defer freeing these hugepages until the entire original allocation
* can be freed
*/
- if (internal_conf
ig.
match_allocations && elem->size != elem->orig_size)
+ if (internal_conf
->
match_allocations && elem->size != elem->orig_size)
goto free_unlock;
/* probably, but let's make sure, as we may not be using up full page */
goto free_unlock;
/* probably, but let's make sure, as we may not be using up full page */
@@
-1323,10
+1327,11
@@
rte_eal_malloc_heap_init(void)
{
struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
unsigned int i;
{
struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
unsigned int i;
+ const struct internal_config *internal_conf =
+ eal_get_internal_configuration();
- if (internal_conf
ig.match_allocations) {
+ if (internal_conf
->match_allocations)
RTE_LOG(DEBUG, EAL, "Hugepages will be freed exactly as allocated.\n");
RTE_LOG(DEBUG, EAL, "Hugepages will be freed exactly as allocated.\n");
- }
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
/* assign min socket ID to external heaps */
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
/* assign min socket ID to external heaps */