Browse code

- reverted shm_resize from an alias for shm_realloc to the old de-alloc; alloc behaviour (slower but less fragmentation)

Andrei Pelinescu-Onciul authored on 19/11/2003 19:05:13
Showing 4 changed files
... ...
@@ -280,6 +280,7 @@ DEFS+= $(extra_defs) \
280 280
 	 -DDISABLE_NAGLE \
281 281
 	 -DF_MALLOC \
282 282
 	# -DDBG_QM_MALLOC \
283
+	# -DDBG_QM_MALLOC \
283 284
 	# -DF_MALLOC \
284 285
 	# -DDBG_F_MALLOC \
285 286
 	# -DDBG_QM_MALLOC \
... ...
@@ -89,8 +89,7 @@ inline static void* sh_realloc(void* p, unsigned int size)
89 89
 */
90 90
 
91 91
 #ifdef DBG_QM_MALLOC
92
-void* _shm_resize( void* p, unsigned int s, char* file, char* func,
93
-					unsigned int line)
92
+void* _shm_resize( void* p, unsigned int s, char* file, char* func, int line)
94 93
 #else
95 94
 void* _shm_resize( void* p , unsigned int s)
96 95
 #endif
... ...
@@ -29,6 +29,8 @@
29 29
  * History:
30 30
  * --------
31 31
  *  2003-06-29  added shm_realloc & replaced shm_resize (andrei)
32
+ *  2003-11-19  reverted shm_resize to the old version, using
33
+ *               realloc causes terrible fragmentation  (andrei)
32 34
  */
33 35
 
34 36
 
... ...
@@ -165,11 +167,14 @@ do { \
165 167
 
166 168
 
167 169
 
168
-#define shm_resize(_p, _s ) shm_realloc( (_p), (_s))
170
+void* _shm_resize(void* ptr, unsigned int size, char* f, char* fn, int line);
171
+#define shm_resize(_p, _s ) _shm_resize((_p), (_s), \
172
+		__FILE__, __FUNCTION__, __LINE__ )
173
+/*#define shm_resize(_p, _s ) shm_realloc( (_p), (_s))*/
169 174
 
170 175
 
171 176
 
172
-#else
177
+#else /*DBQ_QM_MALLOC*/
173 178
 
174 179
 
175 180
 #define shm_malloc_unsafe(_size) MY_MALLOC(shm_block, (_size))
... ...
@@ -207,7 +212,9 @@ do { \
207 212
 
208 213
 
209 214
 
210
-#define shm_resize(_p, _s) shm_realloc( (_p), (_s))
215
+void* _shm_resize(void* ptr, unsigned int size);
216
+#define shm_resize(_p, _s) _shm_resize( (_p), (_s))
217
+/*#define shm_resize(_p, _s) shm_realloc( (_p), (_s))*/
211 218
 
212 219
 
213 220
 #endif
... ...
@@ -16,6 +16,7 @@
16 16
 check_via=no     # (cmd. line: -v)
17 17
 dns=no          # (cmd. line: -r)
18 18
 rev_dns=no      # (cmd. line: -R)
19
+mem_log=0
19 20
 #port=5070
20 21
 #listen=127.0.0.1
21 22
 #listen=195.37.77.101