All pastes #342396 Raw Edit

Someone

public text v1 · immutable
·published 2007-02-06 08:17 UTC
rendered paste body
#define CHECK_IN_PTR(ptr, real_ptr, len, fname) { \
    if (ptr == 0) \
        msg_panic("%s: null pointer input", fname); \
    real_ptr = (MBLOCK *) (ptr - offsetof(MBLOCK, u.payload[0])); \
    if (real_ptr->signature != SIGNATURE) \
        msg_panic("%s: corrupt or unallocated memory block", fname); \
    real_ptr->signature = 0; \
    if ((len = real_ptr->length) < 1) \
        msg_panic("%s: corrupt memory block length", fname); \
}