This website works better with JavaScript.
Home
Explore
Help
Sign In
RuhNetConsulting
/
rtpengine
mirror of
https://github.com/sipwise/rtpengine
Watch
1
Star
1
Fork
0
Code
Issues
0
Projects
0
Releases
822
Wiki
Activity
Browse Source
MT#55283 move alignment macros to header file
Change-Id: I266cbefe8351f77399bb6e50b2122f9a45249529
pull/1923/head
Richard Fuchs
9 months ago
parent
1a98502a1b
commit
5f9e43b3e0
2 changed files
with
4 additions
and
3 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-3
lib/bufferpool.c
+3
-0
lib/bufferpool.h
+ 1
- 3
lib/bufferpool.c
View File
@ -3,8 +3,6 @@
#
include
<stdbool.h>
#
include
"obj.h"
#
define ALIGN 8
/
/
bytes
struct
bufferpool
{
void
*
(
*
alloc
)
(
size_t
)
;
void
(
*
dealloc
)
(
void
*
)
;
@ -154,7 +152,7 @@ void *bufferpool_alloc(struct bufferpool *bp, size_t len) {
void
*
ret
=
shard
-
>
head
;
shard
-
>
refs
+
+
;
shard
-
>
head
+
=
(
(
len
+
ALIGN
-
1
)
/
ALIGN
)
*
ALIGN
;
shard
-
>
head
+
=
BUFFERPOOL_ALIGN
(
len
)
;
return
ret
;
}
+ 3
- 0
lib/bufferpool.h
View File
@ -3,6 +3,9 @@
#
include
"obj.h"
#
define BUFFERPOOL_ALIGNMENT (sizeof(void *))
/
/
bytes
#
define BUFFERPOOL_ALIGN(x) (((x + BUFFERPOOL_ALIGNMENT - 1)
/
BUFFERPOOL_ALIGNMENT) * BUFFERPOOL_ALIGNMENT)
struct
bufferpool
;
struct
bpool_shard
;
Write
Preview
Loading…
Cancel
Save