bug fixes from modules/malloc; changed formats to use %p

This commit is contained in:
eck
1990-01-18 17:24:18 +00:00
parent 6457b9560b
commit 1e086f7268
3 changed files with 29 additions and 27 deletions

View File

@@ -18,19 +18,19 @@ publicdata mallink *ml_last;
#define __bits(ml) ((size_type)_phys_prev_of(ml) & BITS)
#define __free_of(ml) ((size_type)_phys_prev_of(ml) & FREE_BIT)
#define __phys_prev_of(ml) (mallink *)((size_type)_phys_prev_of(ml) & ~FREE_BIT)
#define __phys_prev_of(ml) (mallink *)((size_type)_phys_prev_of(ml) & ~BITS)
#define prev_size_of(ml) ((char *)(ml) - \
(char *)__phys_prev_of(ml) - \
mallink_size() \
)
#define set_phys_prev(ml,e) \
(_phys_prev_of(ml) = (mallink *) ((char *)e + __free_of(ml)))
(_phys_prev_of(ml) = (mallink *) ((char *)e + __bits(ml)))
#ifdef CHECK
public Error(const char *fmt, const char *s, mallinkl *ml);
public Error(const char *fmt, const char *s, mallink *ml);
#define phys_prev_of(ml) (mallink *) \
(first_mallink(ml) ? \
(char *)Error("phys_prev_of first_mallink %ld", "somewhere", ml) : \
(char *)Error("phys_prev_of first_mallink %p", "somewhere", ml) : \
(char *)__phys_prev_of(ml) \
)
#else /* ndef CHECK */