File tree 2 files changed +23
-0
lines changed 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 108
108
#include "globals.h"
109
109
#include "mem/mem.h"
110
110
#include "mem/shm_mem.h"
111
+ #include "mem/rpm_mem.h"
111
112
#include "sr_module.h"
112
113
#include "timer.h"
113
114
#include "ipc.h"
@@ -962,6 +963,13 @@ int main(int argc, char** argv)
962
963
goto error00 ;
963
964
}
964
965
break ;
966
+ case 'e' :
967
+ if (set_rpm_mm (optarg ) < 0 ) {
968
+ LM_ERR ("current build does not support "
969
+ "this allocator (-e %s)\n" , optarg );
970
+ goto error00 ;
971
+ }
972
+ break ;
965
973
}
966
974
}
967
975
@@ -1011,6 +1019,7 @@ int main(int argc, char** argv)
1011
1019
case 'a' :
1012
1020
case 'k' :
1013
1021
case 's' :
1022
+ case 'e' :
1014
1023
/* ignoring, parsed previously */
1015
1024
break ;
1016
1025
case 'b' :
Original file line number Diff line number Diff line change @@ -39,6 +39,20 @@ enum osips_mm mem_allocator_rpm = MM_NONE;
39
39
unsigned long rpm_mem_size = 0 ;
40
40
char * rpm_mem_file = RESTART_PERSISTENCY_MEM_FILE ;
41
41
42
+ int set_rpm_mm (const char * mm_name )
43
+ {
44
+ #ifdef INLINE_ALLOC
45
+ LM_NOTICE ("this is an inlined allocator build (see opensips -V), "
46
+ "cannot set a custom rpm allocator (%s)\n" , mm_name );
47
+ return 0 ;
48
+ #endif
49
+
50
+ if (parse_mm (mm_name , & mem_allocator_rpm ) < 0 )
51
+ return -1 ;
52
+
53
+ return 0 ;
54
+ }
55
+
42
56
#ifndef INLINE_ALLOC
43
57
#ifdef DBG_MALLOC
44
58
void * (* gen_rpm_malloc )(void * blk , unsigned long size ,
You can’t perform that action at this time.
0 commit comments