Splice a buffer into another buffer. Note that it's up to the caller to * bounds check the offset and size. The resulting buffer is backed by the same * storage as the original, so although it is valid to buffer_delete() either * one of them, doing so releases both simultaneously. */
| 81 | * storage as the original, so although it is valid to buffer_delete() either |
| 82 | * one of them, doing so releases both simultaneously. */ |
| 83 | static inline void buffer_splice(struct buffer *dest, const struct buffer *src, |
| 84 | size_t offset, size_t size) |
| 85 | { |
| 86 | dest->name = src->name; |
| 87 | dest->data = src->data + offset; |
| 88 | dest->offset = src->offset + offset; |
| 89 | dest->size = size; |
| 90 | } |
| 91 | |
| 92 | /* |
| 93 | * Shallow copy a buffer. To clean up the resources, buffer_delete() |
no outgoing calls
no test coverage detected