1 |
blueness 14/07/26 14:12:51 |
2 |
|
3 |
Added: monkeyd-1.5.2-use-system-jemalloc.patch |
4 |
Removed: monkeyd-1.4.0-use-system-jemalloc.patch |
5 |
monkeyd-1.5.0-use-system-jemalloc.patch |
6 |
Log: |
7 |
Fix bug #518086 |
8 |
|
9 |
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0xF52D4BBA) |
10 |
|
11 |
Revision Changes Path |
12 |
1.1 www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch?rev=1.1&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch?rev=1.1&content-type=text/plain |
16 |
|
17 |
Index: monkeyd-1.5.2-use-system-jemalloc.patch |
18 |
=================================================================== |
19 |
diff -Naur monkey-1.5.2.orig/configure monkey-1.5.2/configure |
20 |
--- monkey-1.5.2.orig/configure 2014-07-19 23:27:13.000000000 -0400 |
21 |
+++ monkey-1.5.2/configure 2014-07-26 10:07:08.808171546 -0400 |
22 |
@@ -193,7 +193,7 @@ |
23 |
|
24 |
echo "+ Creating src/Makefile" |
25 |
create_makefile2 mod_libs mod_obj make_script platform \ |
26 |
- malloc_libc malloc_jemalloc |
27 |
+ malloc_libc |
28 |
|
29 |
echo "+ Creating plugins/Make.common" |
30 |
create_plugins_make_common bindir |
31 |
@@ -210,33 +210,12 @@ |
32 |
|
33 |
echo -e "+ Creating Makefile" |
34 |
if [ "$dir" = 0 ]; then |
35 |
- create_makefile1 bindir malloc_jemalloc |
36 |
+ create_makefile1 bindir |
37 |
else |
38 |
create_makefile1_install prefix bindir mandir sysconfdir \ |
39 |
- datadir logdir malloc_jemalloc |
40 |
+ datadir logdir |
41 |
fi |
42 |
|
43 |
- # if the memory allocator is jemalloc, lets start configuring the dependency |
44 |
- if [ $malloc_jemalloc -eq 1 ]; then |
45 |
- echo |
46 |
- echo -e "\033[1m=== Configuring Memory Allocator ===\033[0m" |
47 |
- cd deps/jemalloc |
48 |
- ./configure $JEMALLOC_OPTS \ |
49 |
- --with-jemalloc-prefix=je_ \ |
50 |
- --enable-cc-silence \ |
51 |
- CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " \ |
52 |
- LDFLAGS="" > jemalloc.config 2>&1 |
53 |
- if [ $? -eq 0 ]; then |
54 |
- echo "+ Jemalloc configured" |
55 |
- else |
56 |
- cat jemalloc.config |
57 |
- echo |
58 |
- echo "check more details with: $ cat deps/jemalloc/config.log" |
59 |
- exit 1 |
60 |
- fi |
61 |
- cd ../../ |
62 |
- fi |
63 |
- |
64 |
echo |
65 |
echo -e "\033[1m=== Monkey Configuration ===\033[0m" |
66 |
echo -e "Platform\t= $platform" |
67 |
@@ -316,12 +295,6 @@ |
68 |
# Create Makefile |
69 |
create_makefile1() |
70 |
{ |
71 |
- if [ $malloc_jemalloc -eq 1 ]; then |
72 |
- $deps="deps/jemalloc" |
73 |
- else |
74 |
- $deps="" |
75 |
- fi |
76 |
- |
77 |
cat > Makefile << EOF |
78 |
# Monkey HTTP Daemon: Makefile |
79 |
# ============================ |
80 |
@@ -459,13 +432,6 @@ |
81 |
|
82 |
create_makefile1_install() |
83 |
{ |
84 |
- # memory allocator |
85 |
- if [ $malloc_jemalloc -eq 1 ]; then |
86 |
- all_deps="$all_deps jemalloc" |
87 |
- else |
88 |
- deps="" |
89 |
- fi |
90 |
- |
91 |
# remove old data |
92 |
rm -rf plugins.conf plugins.list |
93 |
touch plugins.conf |
94 |
@@ -523,10 +489,6 @@ |
95 |
@\$(MAKE) -s -C plugins all |
96 |
@echo " DONE" |
97 |
|
98 |
-jemalloc: |
99 |
- @echo " CC jemalloc [all]" |
100 |
- @\$(MAKE) -s -C deps/jemalloc |
101 |
- |
102 |
clean: |
103 |
@(cd src; \$(MAKE) clean) |
104 |
@(cd plugins; \$(MAKE) clean) |
105 |
@@ -605,9 +567,7 @@ |
106 |
fi |
107 |
|
108 |
if [ $malloc_jemalloc -eq 1 ]; then |
109 |
- extra="../deps/jemalloc/lib/libjemalloc.a" |
110 |
- extraso="-Wl,--whole-archive ../deps/jemalloc/lib/libjemalloc_pic.a -Wl,--no-whole-archive" |
111 |
- libs="$libs -lm" |
112 |
+ libs="$libs -ljemalloc" |
113 |
fi |
114 |
|
115 |
cat > src/Makefile<<EOF |
116 |
diff -Naur monkey-1.5.2.orig/src/include/mk_memory.h monkey-1.5.2/src/include/mk_memory.h |
117 |
--- monkey-1.5.2.orig/src/include/mk_memory.h 2014-07-19 23:27:13.000000000 -0400 |
118 |
+++ monkey-1.5.2/src/include/mk_memory.h 2014-07-26 10:08:06.427168785 -0400 |
119 |
@@ -23,7 +23,7 @@ |
120 |
#include <stdio.h> |
121 |
|
122 |
#ifdef MALLOC_JEMALLOC |
123 |
-#include "../../deps/jemalloc/include/jemalloc/jemalloc.h" |
124 |
+#include <jemalloc/jemalloc.h> |
125 |
#endif |
126 |
|
127 |
#include "mk_macros.h" |
128 |
@@ -43,11 +43,7 @@ |
129 |
static inline ALLOCSZ_ATTR(1) |
130 |
void *mk_mem_malloc(const size_t size) |
131 |
{ |
132 |
-#ifdef MALLOC_JEMALLOC |
133 |
- void *aux = je_malloc(size); |
134 |
-#else |
135 |
void *aux = malloc(size); |
136 |
-#endif |
137 |
|
138 |
if (mk_unlikely(!aux && size)) { |
139 |
perror("malloc"); |
140 |
@@ -60,11 +56,7 @@ |
141 |
static inline ALLOCSZ_ATTR(1) |
142 |
void *mk_mem_malloc_z(const size_t size) |
143 |
{ |
144 |
-#ifdef MALLOC_JEMALLOC |
145 |
- void *buf = je_calloc(1, size); |
146 |
-#else |
147 |
void *buf = calloc(1, size); |
148 |
-#endif |
149 |
|
150 |
if (mk_unlikely(!buf)) { |
151 |
return NULL; |
152 |
@@ -76,11 +68,7 @@ |
153 |
static inline ALLOCSZ_ATTR(2) |
154 |
void *mk_mem_realloc(void *ptr, const size_t size) |
155 |
{ |
156 |
-#ifdef MALLOC_JEMALLOC |
157 |
- void *aux = je_realloc(ptr, size); |
158 |
-#else |
159 |
void *aux = realloc(ptr, size); |
160 |
-#endif |
161 |
|
162 |
if (mk_unlikely(!aux && size)) { |
163 |
perror("realloc"); |
164 |
@@ -92,11 +80,7 @@ |
165 |
|
166 |
static inline void mk_mem_free(void *ptr) |
167 |
{ |
168 |
-#ifdef MALLOC_JEMALLOC |
169 |
- je_free(ptr); |
170 |
-#else |
171 |
free(ptr); |
172 |
-#endif |
173 |
} |
174 |
|
175 |
void mk_mem_free(void *ptr); |