add: if (qm->max_real_used<qm->real_used) qm->max_real_used=qm->real_used;
context: void* qm_malloc(struct qm_block* qm, unsigned int size){	struct qm_frag* f;	struct qm_frag_end* end;	struct qm_frag* n;	unsigned int rest;	unsigned int overhead;		/*size must be a multiple of 8*/	size=(size%8)?(size+8)/8*8:size;	if (size>(qm->size-qm->real_used)) return 0;	if (qm->free_lst.u.nxt_free==&(qm->free_lst)) return 0;	/*search for a suitable free frag*/	for (f=qm->free_lst.u.nxt_free; f!=&(qm->free_lst); f=f->u.nxt_free){		if (f->size>=size){			/* we found it!*/			/*detach it from the free list*/			qm_detach_free(qm, f);			/*mark it as "busy"*/			f->u.is_free=0;						/*see if we'll use full frag, or we'll split it in 2*/			rest=f->size-size;			overhead=sizeof(struct qm_frag)+sizeof(struct qm_frag_end);			if (rest>overhead){				f->size=size;				/*split the fragment*/				end=FRAG_END(f);				end->size=size;				n=(struct qm_frag*)((char*)end+sizeof(struct qm_frag_end));				n->size=rest-overhead;				FRAG_END(n)->size=n->size;				qm->real_used+=overhead;				/* reinsert n in free list*/				qm_insert_free(qm, n);			}else{				/* we cannot split this fragment any more => alloc all of it*/			}			qm->real_used+=f->size;			qm->used+=f->size;			return (char*)f+sizeof(struct qm_frag);		}	}	return 0;}