u_debug_refcnt: Don't loop for initial refcounts if the initial value is huge
Some components use very large refcounts to bypass atomics in single-threaded cases, and this produces near-infinite loops when these resources are created. Reviewed-by: Sil Vilerino <sivileri@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16182>
This commit is contained in:
parent
0bcb5f919e
commit
d8024b2504
|
@ -174,10 +174,12 @@ debug_reference_slowpath(const struct pipe_reference *p,
|
||||||
/* this is here to provide a gradual change even if we don't see
|
/* this is here to provide a gradual change even if we don't see
|
||||||
* the initialization
|
* the initialization
|
||||||
*/
|
*/
|
||||||
for (i = 1; i <= refcnt - change; ++i) {
|
if (refcnt <= 10) {
|
||||||
fprintf(stream, "<%s> %p %u AddRef %u\n", buf, (void *) p,
|
for (i = 1; i <= refcnt - change; ++i) {
|
||||||
serial, i);
|
fprintf(stream, "<%s> %p %u AddRef %u\n", buf, (void *) p,
|
||||||
debug_backtrace_print(stream, frames, STACK_LEN);
|
serial, i);
|
||||||
|
debug_backtrace_print(stream, frames, STACK_LEN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue