def invalid_pointer(ptr, size)
      errmsg = "free(): invalid pointer\n"
      # unsigned compare
      malloc_assert(ptr <= ulong(-size)) { errmsg + format('ptr(0x%x) > -size(0x%x)', ptr, ulong(-size)) }
      malloc_assert((ptr % (size_t * 2)).zero?) { errmsg + format('ptr(0x%x) %% %d != 0', ptr, size_t * 2) }
    end
def invalid_pointer(ptr, size)
      errmsg = "free(): invalid pointer\n"
      # unsigned compare
      malloc_assert(ptr <= ulong(-size)) { errmsg + format('ptr(0x%x) > -size(0x%x)', ptr, ulong(-size)) }
      malloc_assert((ptr % (size_t * 2)).zero?) { errmsg + format('ptr(0x%x) %% %d != 0', ptr, size_t * 2) }
    end
Start of checkers