summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/pipebuffer/pb_buffer.h
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-01-28 15:53:21 +0000
committerJosé Fonseca <[email protected]>2009-01-28 15:54:13 +0000
commit1be4d4d4c6af61bda9e682e3fd347228d2589f8a (patch)
tree5794b78e8ab491b9dcc0812a64037f8e4bd195d0 /src/gallium/auxiliary/pipebuffer/pb_buffer.h
parent815de0a5dfadbe9a2618b94c4f28a799cc501a14 (diff)
pipebuffer: More assertions.
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer/pb_buffer.h')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
index a4650e469fb..fb0ba159485 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
@@ -148,6 +148,7 @@ pb_map(struct pb_buffer *buf,
assert(buf);
if(!buf)
return NULL;
+ assert(buf->base.refcount > 0);
return buf->vtbl->map(buf, flags);
}
@@ -158,6 +159,7 @@ pb_unmap(struct pb_buffer *buf)
assert(buf);
if(!buf)
return;
+ assert(buf->base.refcount > 0);
buf->vtbl->unmap(buf);
}
@@ -173,7 +175,10 @@ pb_get_base_buffer( struct pb_buffer *buf,
offset = 0;
return;
}
+ assert(buf->base.refcount > 0);
buf->vtbl->get_base_buffer(buf, base_buf, offset);
+ assert(*base_buf);
+ assert(*offset < (*base_buf)->base.size);
}