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 165
 
166 166
 
167 167
 
168
-#define shm_resize(_p, _s ) shm_realloc( (_p), (_s))
168
+void* _shm_resize(void* ptr, unsigned int size, char* f, char* fn, int line);
169
+#define shm_resize(_p, _s ) _shm_resize((_p), (_s), \
170
+		__FILE__, __FUNCTION__, __LINE__ )
171
+/*#define shm_resize(_p, _s ) shm_realloc( (_p), (_s))*/
169 172
 
170 173
 
171 174
 
172
-#else
175
+#else /*DBQ_QM_MALLOC*/
173 176
 
174 177
 
175 178
 #define shm_malloc_unsafe(_size) MY_MALLOC(shm_block, (_size))
... ...
@@ -207,7 +212,9 @@ do { \
207 207
 
208 208
 
209 209
 
210
-#define shm_resize(_p, _s) shm_realloc( (_p), (_s))
210
+void* _shm_resize(void* ptr, unsigned int size);
211
+#define shm_resize(_p, _s) _shm_resize( (_p), (_s))
212
+/*#define shm_resize(_p, _s) shm_realloc( (_p), (_s))*/
211 213
 
212 214
 
213 215
 #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