Skip to content
Snippets Groups Projects
Commit c1bfc720 authored by Simon McVittie's avatar Simon McVittie
Browse files

utils: Add doc-comments for xadd, xmul

parent ff33964f
Branches
Tags
1 merge request!729Optionally emit priority level markers on bubblewrap messages
...@@ -952,6 +952,10 @@ mount_strerror (int errsv) ...@@ -952,6 +952,10 @@ mount_strerror (int errsv)
} }
} }
/*
* Return a + b if it would not overflow.
* Die with an "out of memory" error if it would.
*/
static size_t static size_t
xadd (size_t a, size_t b) xadd (size_t a, size_t b)
{ {
...@@ -961,6 +965,10 @@ xadd (size_t a, size_t b) ...@@ -961,6 +965,10 @@ xadd (size_t a, size_t b)
return result; return result;
} }
/*
* Return a * b if it would not overflow.
* Die with an "out of memory" error if it would.
*/
static size_t static size_t
xmul (size_t a, size_t b) xmul (size_t a, size_t b)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment