os_stream_write(stream, "\n", 1);
}
-void debug_reference_slowpath(const struct pipe_reference* p, void* pget_desc, int change)
+void debug_reference_slowpath(const struct pipe_reference* p, debug_reference_descriptor get_desc, int change)
{
if(debug_refcnt_state < 0)
return;
const char* symbols[STACK_LEN];
char buf[1024];
- void (*get_desc)(char*, const struct pipe_reference*) = pget_desc;
unsigned i;
unsigned refcnt = p->count;
unsigned serial;
extern "C" {
#endif
+typedef void (*debug_reference_descriptor)(char*, const struct pipe_reference*);
+
#if defined(DEBUG) && (!defined(PIPE_OS_WINDOWS) || defined(PIPE_SUBSYSTEM_WINDOWS_USER))
+
extern int debug_refcnt_state;
-void debug_reference_slowpath(const struct pipe_reference* p, void* get_desc, int change);
+void debug_reference_slowpath(const struct pipe_reference* p, debug_reference_descriptor get_desc, int change);
-static INLINE void debug_reference(const struct pipe_reference* p, void* get_desc, int change)
+static INLINE void debug_reference(const struct pipe_reference* p, debug_reference_descriptor get_desc, int change)
{
- if(debug_refcnt_state >= 0)
- debug_reference_slowpath(p, get_desc, change);
+ if (debug_refcnt_state >= 0)
+ debug_reference_slowpath(p, get_desc, change);
}
+
#else
-static INLINE void debug_reference(const struct pipe_reference* p, void* get_desc, const char* op)
-{}
+
+static INLINE void debug_reference(const struct pipe_reference* p, debug_reference_descriptor get_desc, int change)
+{
+}
+
#endif
#ifdef __cplusplus
* \return TRUE if the object's refcount hits zero and should be destroyed.
*/
static INLINE boolean
-pipe_reference_described(struct pipe_reference *ptr, struct pipe_reference *reference, void* get_desc)
+pipe_reference_described(struct pipe_reference *ptr,
+ struct pipe_reference *reference,
+ debug_reference_descriptor get_desc)
{
boolean destroy = FALSE;
static INLINE boolean
pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference)
{
- return pipe_reference_described(ptr, reference, debug_describe_reference);
+ return pipe_reference_described(ptr, reference,
+ (debug_reference_descriptor)debug_describe_reference);
}
static INLINE void
{
struct pipe_surface *old_surf = *ptr;
- if (pipe_reference_described(&(*ptr)->reference, &surf->reference, debug_describe_surface))
+ if (pipe_reference_described(&(*ptr)->reference, &surf->reference,
+ (debug_reference_descriptor)debug_describe_surface))
old_surf->texture->screen->tex_surface_destroy(old_surf);
*ptr = surf;
}
{
struct pipe_resource *old_tex = *ptr;
- if (pipe_reference_described(&(*ptr)->reference, &tex->reference, debug_describe_resource))
+ if (pipe_reference_described(&(*ptr)->reference, &tex->reference,
+ (debug_reference_descriptor)debug_describe_resource))
old_tex->screen->resource_destroy(old_tex->screen, old_tex);
*ptr = tex;
}
{
struct pipe_sampler_view *old_view = *ptr;
- if (pipe_reference_described(&(*ptr)->reference, &view->reference, debug_describe_sampler_view))
+ if (pipe_reference_described(&(*ptr)->reference, &view->reference,
+ (debug_reference_descriptor)debug_describe_sampler_view))
old_view->context->sampler_view_destroy(old_view->context, old_view);
*ptr = view;
}