#define checksum_of(ml) (_checksum_of(ml))
#endif CHECK
+#define new_mallink(ml) ( _log_prev_of(ml) = 0, \
+ _log_next_of(ml) = 0, \
+ _phys_prev_of(ml) = 0, \
+ _this_size_of(ml) = 0 )
#define block_of_mallink(ml) ((char *)ml)
#define mallink_of_block(addr) ((mallink *)addr)
}
ml = mallink_of_block(addr);
if (n < MIN_SIZE) n = align(MIN_SIZE); else n = align(n);
+#ifdef STORE
+ if (in_store(ml)) {
+ register mallink *stp = store[(size_of(ml) >> LOG_MIN_SIZE) - 1];
+ mallink *stp1 = 0;
+ while (ml != stp) {
+ stp1 = stp;
+ stp = log_next_of(stp);
+ }
+ stp = log_next_of(stp);
+ if (! stp1) store[(size_of(ml) >> LOG_MIN_SIZE) - 1] = stp;
+ else set_log_next(stp1, stp);
+ set_store(ml, 0);
+ }
+#endif
if (free_of(ml)) {
unlink_free_chunk(ml);
set_free(ml, 0); /* user reallocs free block */
assert(!last || p == (char *)phys_next_of(last) - mallink_size());
ml = (mallink *)(p + mallink_size()); /* bump ml */
+ new_mallink(ml);
started_working_on(ml);
set_free(ml, 1);
set_phys_prev(ml, last);
register mallink *new = (mallink *)((char *)ml + size);
register mallink *ph_next = phys_next_of(ml);
+ new_mallink(new);
set_free(new, 1);
set_phys_prev(new, ml);
set_phys_next(new, ph_next);