Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
session: api to add new transport types
[vpp.git]
/
src
/
vlibmemory
/
memory_shared.c
diff --git
a/src/vlibmemory/memory_shared.c
b/src/vlibmemory/memory_shared.c
index
0b232ad
..
1716f27
100644
(file)
--- a/
src/vlibmemory/memory_shared.c
+++ b/
src/vlibmemory/memory_shared.c
@@
-163,15
+163,13
@@
vl_msg_api_alloc_internal (svm_region_t * vlib_rp, int nbytes, int pool,
*/
am->ring_misses++;
*/
am->ring_misses++;
- pthread_mutex_lock (&vlib_rp->mutex);
- oldheap = svm_push_data_heap (vlib_rp);
+ oldheap = vl_msg_push_heap_w_region (vlib_rp);
if (may_return_null)
{
rv = clib_mem_alloc_or_null (nbytes);
if (PREDICT_FALSE (rv == 0))
{
if (may_return_null)
{
rv = clib_mem_alloc_or_null (nbytes);
if (PREDICT_FALSE (rv == 0))
{
- svm_pop_heap (oldheap);
- pthread_mutex_unlock (&vlib_rp->mutex);
+ vl_msg_pop_heap_w_region (vlib_rp, oldheap);
return 0;
}
}
return 0;
}
}
@@
-180,8
+178,7
@@
vl_msg_api_alloc_internal (svm_region_t * vlib_rp, int nbytes, int pool,
rv->q = 0;
rv->gc_mark_timestamp = 0;
rv->q = 0;
rv->gc_mark_timestamp = 0;
- svm_pop_heap (oldheap);
- pthread_mutex_unlock (&vlib_rp->mutex);
+ vl_msg_pop_heap_w_region (vlib_rp, oldheap);
out:
#if DEBUG_MESSAGE_BUFFER_OVERRUN > 0
out:
#if DEBUG_MESSAGE_BUFFER_OVERRUN > 0
@@
-296,8
+293,7
@@
vl_msg_api_free_w_region (svm_region_t * vlib_rp, void *a)
return;
}
return;
}
- pthread_mutex_lock (&vlib_rp->mutex);
- oldheap = svm_push_data_heap (vlib_rp);
+ oldheap = vl_msg_push_heap_w_region (vlib_rp);
#if DEBUG_MESSAGE_BUFFER_OVERRUN > 0
{
#if DEBUG_MESSAGE_BUFFER_OVERRUN > 0
{
@@
-308,8
+304,7
@@
vl_msg_api_free_w_region (svm_region_t * vlib_rp, void *a)
#endif
clib_mem_free (rv);
#endif
clib_mem_free (rv);
- svm_pop_heap (oldheap);
- pthread_mutex_unlock (&vlib_rp->mutex);
+ vl_msg_pop_heap_w_region (vlib_rp, oldheap);
}
void
}
void