uw_mallac:

You try realloc and if the new pointer is a different one you fail -
causing all callback functions to be called maybe accessing memory
which may have been overridden by other threads because realloc allowed
it to be reused.

So if uw_malloc returns memory blocks which you can reuse in those
handlers than its a bug.

  static void buf_check_ctx(uw_context ctx, const char *kind, buf *b, size_t 
extra, const char *desc) {
    if (b->back - b->front < extra) {
      // ....
      }
      // ..
      if (new_heap != b->start) {
        b->start = new_heap;
        uw_error(ctx, UNLIMITED_RETRY, "Couldn't allocate new %s contiguously", 
desc);
      }

Marc Weber

_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to