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
trace: remove limitation on patterns number
[dpdk.git]
/
lib
/
librte_eal
/
common
/
malloc_elem.c
diff --git
a/lib/librte_eal/common/malloc_elem.c
b/lib/librte_eal/common/malloc_elem.c
index
658c9b5
..
51cdfc5
100644
(file)
--- a/
lib/librte_eal/common/malloc_elem.c
+++ b/
lib/librte_eal/common/malloc_elem.c
@@
-171,7
+171,7
@@
malloc_elem_insert(struct malloc_elem *elem)
next_elem = NULL;
heap->last = elem;
} else {
next_elem = NULL;
heap->last = elem;
} else {
- /* the new memory is somewhere
in
between start and end */
+ /* the new memory is somewhere between start and end */
uint64_t dist_from_start, dist_from_end;
dist_from_end = RTE_PTR_DIFF(heap->last, elem);
uint64_t dist_from_start, dist_from_end;
dist_from_end = RTE_PTR_DIFF(heap->last, elem);
@@
-307,6
+307,11
@@
split_elem(struct malloc_elem *elem, struct malloc_elem *split_pt)
elem->next = split_pt;
elem->size = old_elem_size;
set_trailer(elem);
elem->next = split_pt;
elem->size = old_elem_size;
set_trailer(elem);
+ if (elem->pad) {
+ /* Update inner padding inner element size. */
+ elem = RTE_PTR_ADD(elem, elem->pad);
+ elem->size = old_elem_size - elem->pad;
+ }
}
/*
}
/*
@@
-482,6
+487,10
@@
join_elem(struct malloc_elem *elem1, struct malloc_elem *elem2)
else
elem1->heap->last = elem1;
elem1->next = next;
else
elem1->heap->last = elem1;
elem1->next = next;
+ if (elem1->pad) {
+ struct malloc_elem *inner = RTE_PTR_ADD(elem1, elem1->pad);
+ inner->size = elem1->size - elem1->pad;
+ }
}
struct malloc_elem *
}
struct malloc_elem *