Browse code

- shm_resize fix merged from testing_0_8_12

Andrei Pelinescu-Onciul authored on 20/11/2003 20:57:15
Showing 2 changed files
... ...
@@ -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