};
-static INLINE struct pb_debug_buffer *
+static inline struct pb_debug_buffer *
pb_debug_buffer(struct pb_buffer *buf)
{
assert(buf);
}
-static INLINE struct pb_debug_manager *
+static inline struct pb_debug_manager *
pb_debug_manager(struct pb_manager *mgr)
{
assert(mgr);
};
-static INLINE void
+static inline void
fill_random_pattern(uint8_t *dst, pb_size size)
{
pb_size i = 0;
}
-static INLINE boolean
+static inline boolean
check_random_pattern(const uint8_t *dst, pb_size size,
pb_size *min_ofs, pb_size *max_ofs)
{
map = pb_map(buf->buffer, PB_USAGE_CPU_WRITE, NULL);
assert(map);
- if(map) {
+ if (map) {
fill_random_pattern(map, buf->underflow_size);
fill_random_pattern(map + buf->underflow_size + buf->base.size,
buf->overflow_size);
PB_USAGE_CPU_READ |
PB_USAGE_UNSYNCHRONIZED, NULL);
assert(map);
- if(map) {
+ if (map) {
boolean underflow, overflow;
pb_size min_ofs, max_ofs;
pb_debug_buffer_check(buf);
map = pb_map(buf->buffer, flags, flush_ctx);
- if(!map)
+ if (!map)
return NULL;
- if(map) {
- pipe_mutex_lock(buf->mutex);
- ++buf->map_count;
- debug_backtrace_capture(buf->map_backtrace, 1, PB_DEBUG_MAP_BACKTRACE);
- pipe_mutex_unlock(buf->mutex);
- }
+ pipe_mutex_lock(buf->mutex);
+ ++buf->map_count;
+ debug_backtrace_capture(buf->map_backtrace, 1, PB_DEBUG_MAP_BACKTRACE);
+ pipe_mutex_unlock(buf->mutex);
return (uint8_t *)map + buf->underflow_size;
}
assert(desc->alignment);
buf = CALLOC_STRUCT(pb_debug_buffer);
- if(!buf)
+ if (!buf)
return NULL;
real_size = mgr->underflow_size + size + mgr->overflow_size;
{
struct pb_debug_manager *mgr;
- if(!provider)
+ if (!provider)
return NULL;
mgr = CALLOC_STRUCT(pb_debug_manager);