MCPcopy Create free account
hub / github.com/coreboot/coreboot / buffer_splice

Function buffer_splice

util/cbfstool/common.h:83–90  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

81 * storage as the original, so although it is valid to buffer_delete() either
82 * one of them, doing so releases both simultaneously. */
83static 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()

Callers 15

write_partition_to_fileFunction · 0.85
bzp_output_segmentFunction · 0.85
write_elfFunction · 0.85
rmodule_stage_to_elfFunction · 0.85
add_topswap_bootblockFunction · 0.85
cbfs_payload_decompressFunction · 0.85
cbfs_payload_make_elfFunction · 0.85
phdr_readFunction · 0.85
shdr_readFunction · 0.85
reloc_readFunction · 0.85
strtab_readFunction · 0.85
symtab_readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected