projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lttng-{enable-event(1),event-rule(7)}: `--filter` is not always avail.
[lttng-tools.git]
/
src
/
common
/
dynamic-buffer.c
diff --git
a/src/common/dynamic-buffer.c
b/src/common/dynamic-buffer.c
index b6544e62ba5f3f646bd9bd1630a9ca5668b5f190..4e87c58ac1b43778cee695bbe2f78596b99d3f8d 100644
(file)
--- a/
src/common/dynamic-buffer.c
+++ b/
src/common/dynamic-buffer.c
@@
-17,10
+17,9
@@
static
size_t round_to_power_of_2(size_t val)
{
static
size_t round_to_power_of_2(size_t val)
{
- int order;
size_t rounded;
size_t rounded;
+ const int order = utils_get_count_order_u64(val);
- order = utils_get_count_order_u64(val);
assert(order >= 0);
rounded = (1ULL << order);
assert(rounded >= val);
assert(order >= 0);
rounded = (1ULL << order);
assert(rounded >= val);
@@
-135,6
+134,7
@@
int lttng_dynamic_buffer_set_size(struct lttng_dynamic_buffer *buffer,
* size _before_ making such calls.
*/
}
* size _before_ making such calls.
*/
}
+
buffer->size = new_size;
end:
return ret;
buffer->size = new_size;
end:
return ret;
@@
-168,6
+168,7
@@
int lttng_dynamic_buffer_set_capacity(struct lttng_dynamic_buffer *buffer,
ret = -1;
goto end;
}
ret = -1;
goto end;
}
+
buffer->data = new_buf;
buffer->_capacity = new_capacity;
end:
buffer->data = new_buf;
buffer->_capacity = new_capacity;
end:
@@
-181,9
+182,11
@@
void lttng_dynamic_buffer_reset(struct lttng_dynamic_buffer *buffer)
if (!buffer) {
return;
}
if (!buffer) {
return;
}
+
buffer->size = 0;
buffer->_capacity = 0;
free(buffer->data);
buffer->size = 0;
buffer->_capacity = 0;
free(buffer->data);
+ buffer->data = NULL;
}
LTTNG_HIDDEN
}
LTTNG_HIDDEN
@@
-193,5
+196,6
@@
size_t lttng_dynamic_buffer_get_capacity_left(
if (!buffer) {
return 0;
}
if (!buffer) {
return 0;
}
+
return buffer->_capacity - buffer->size;
}
return buffer->_capacity - buffer->size;
}
This page took
0.028104 seconds
and
4
git commands to generate.