Browse code

- minor malloc debug stuff

Andrei Pelinescu-Onciul authored on 27/07/2004 13:12:33
Showing 1 changed files
... ...
@@ -263,6 +263,7 @@ static inline void qm_detach_free(struct qm_block* qm, struct qm_frag* frag)
263 263
 }
264 264
 
265 265
 
266
+
266 267
 #ifdef DBG_QM_MALLOC
267 268
 static inline struct qm_frag* qm_find_free(struct qm_block* qm, 
268 269
 											unsigned int size,
... ...
@@ -452,6 +453,9 @@ void qm_free(struct qm_block* qm, void* p)
452 452
 	next=FRAG_NEXT(f);
453 453
 	if (((char*)next < (char*)qm->last_frag_end) &&( next->u.is_free)){
454 454
 		/* join */
455
+#ifdef DBG_QM_MALLOC
456
+		qm_debug_frag(qm, next);
457
+#endif
455 458
 		qm_detach_free(qm, next);
456 459
 		size+=next->size+FRAG_OVERHEAD;
457 460
 		qm->real_used-=FRAG_OVERHEAD;
... ...
@@ -463,7 +467,7 @@ void qm_free(struct qm_block* qm, void* p)
463 463
 		/*	(struct qm_frag*)((char*)f - (struct qm_frag_end*)((char*)f-
464 464
 								sizeof(struct qm_frag_end))->size);*/
465 465
 #ifdef DBG_QM_MALLOC
466
-		qm_debug_frag(qm, f);
466
+		qm_debug_frag(qm, prev);
467 467
 #endif
468 468
 		if (prev->u.is_free){
469 469
 			/*join*/