Browse Source

MT#61625 add global memory arena

Change-Id: I49c9f786d0826c090df348eb7ae600f6887611bd
pull/1918/head
Richard Fuchs 10 months ago
parent
commit
fb84336d1a
5 changed files with 9 additions and 1 deletions
  1. +4
    -0
      daemon/main.c
  2. +1
    -1
      include/call.h
  3. +2
    -0
      include/main.h
  4. +1
    -0
      t/test-stats.c
  5. +1
    -0
      t/test-transcode.c

+ 4
- 0
daemon/main.c View File

@ -80,6 +80,7 @@ static GQueue rtpe_cli = G_QUEUE_INIT;
GQueue rtpe_control_ng = G_QUEUE_INIT;
GQueue rtpe_control_ng_tcp = G_QUEUE_INIT;
struct bufferpool *shm_bufferpool;
memory_arena_t rtpe_arena;
struct rtpengine_config rtpe_config = {
// non-zero defaults
@ -1398,6 +1399,8 @@ RTPE_CONFIG_CHARPP_PARAMS
static void early_init(void) {
socket_init(); // needed for socktype_udp
memory_arena_init(&rtpe_arena);
memory_arena = &rtpe_arena;
}
#ifdef WITH_TRANSCODING
@ -1881,6 +1884,7 @@ int main(int argc, char **argv) {
kernel_shutdown_table();
options_free();
bufferpool_cleanup();
memory_arena_free(&rtpe_arena);
return 0;
}

+ 1
- 1
include/call.h View File

@ -943,7 +943,7 @@ INLINE void call_memory_arena_release(void) {
return;
obj_put(call_memory_arena);
call_memory_arena = NULL;
memory_arena = NULL;
memory_arena = &rtpe_arena;
}
INLINE void call_memory_arena_set(call_t *c) {
call_memory_arena_release();


+ 2
- 0
include/main.h View File

@ -7,6 +7,7 @@
#include "socket.h"
#include "auxlib.h"
#include "types.h"
#include "arena.h"
enum xmlrpc_format {
XF_SEMS = 0,
@ -320,6 +321,7 @@ extern GQueue rtpe_control_ng;
extern GQueue rtpe_control_ng_tcp;
extern struct bufferpool *shm_bufferpool;
extern memory_arena_t rtpe_arena;
#endif

+ 1
- 0
t/test-stats.c View File

@ -25,6 +25,7 @@ unsigned int rtpe_poller_rr_iter;
GString *dtmf_logs;
GQueue rtpe_control_ng = G_QUEUE_INIT;
struct bufferpool *shm_bufferpool;
memory_arena_t rtpe_arena;
static void __assert_g_string_eq(GString *a, const char *b, unsigned int line) {
if (strcmp(a->str, b) == 0) {


+ 1
- 0
t/test-transcode.c View File

@ -20,6 +20,7 @@ unsigned int rtpe_poller_rr_iter;
GString *dtmf_logs;
GQueue rtpe_control_ng = G_QUEUE_INIT;
struct bufferpool *shm_bufferpool;
memory_arena_t rtpe_arena;
static str *sdup(char *s) {
str r = STR(s);


Loading…
Cancel
Save