Lines Matching +full:block +full:- +full:size

1 /*-
30 ELFTC_VCSID("$Id: libdwarf_rw.c 3286 2015-12-31 16:45:46Z emaste $");
199 _dwarf_write_lsb_alloc(uint8_t **block, uint64_t *size, uint64_t *offsetp, in _dwarf_write_lsb_alloc() argument
203 assert(*size > 0); in _dwarf_write_lsb_alloc()
205 while (*offsetp + bytes_to_write > *size) { in _dwarf_write_lsb_alloc()
206 *size *= 2; in _dwarf_write_lsb_alloc()
207 *block = realloc(*block, (size_t) *size); in _dwarf_write_lsb_alloc()
208 if (*block == NULL) { in _dwarf_write_lsb_alloc()
214 _dwarf_write_lsb(*block, offsetp, value, bytes_to_write); in _dwarf_write_lsb_alloc()
255 _dwarf_write_msb_alloc(uint8_t **block, uint64_t *size, uint64_t *offsetp, in _dwarf_write_msb_alloc() argument
259 assert(*size > 0); in _dwarf_write_msb_alloc()
261 while (*offsetp + bytes_to_write > *size) { in _dwarf_write_msb_alloc()
262 *size *= 2; in _dwarf_write_msb_alloc()
263 *block = realloc(*block, (size_t) *size); in _dwarf_write_msb_alloc()
264 if (*block == NULL) { in _dwarf_write_msb_alloc()
270 _dwarf_write_msb(*block, offsetp, value, bytes_to_write); in _dwarf_write_msb_alloc()
293 ret |= (-1 << shift); in _dwarf_read_sleb128()
307 return (-1); in _dwarf_write_sleb128()
311 (val == -1 && (*p & 0x40) != 0)) { in _dwarf_write_sleb128()
318 return (p - data); in _dwarf_write_sleb128()
322 _dwarf_write_sleb128_alloc(uint8_t **block, uint64_t *size, uint64_t *offsetp, in _dwarf_write_sleb128_alloc() argument
327 assert(*size > 0); in _dwarf_write_sleb128_alloc()
329 while ((len = _dwarf_write_sleb128(*block + *offsetp, *block + *size, in _dwarf_write_sleb128_alloc()
331 *size *= 2; in _dwarf_write_sleb128_alloc()
332 *block = realloc(*block, (size_t) *size); in _dwarf_write_sleb128_alloc()
333 if (*block == NULL) { in _dwarf_write_sleb128_alloc()
373 return (-1); in _dwarf_write_uleb128()
381 return (p - data); in _dwarf_write_uleb128()
385 _dwarf_write_uleb128_alloc(uint8_t **block, uint64_t *size, uint64_t *offsetp, in _dwarf_write_uleb128_alloc() argument
390 assert(*size > 0); in _dwarf_write_uleb128_alloc()
392 while ((len = _dwarf_write_uleb128(*block + *offsetp, *block + *size, in _dwarf_write_uleb128_alloc()
394 *size *= 2; in _dwarf_write_uleb128_alloc()
395 *block = realloc(*block, (size_t) *size); in _dwarf_write_uleb128_alloc()
396 if (*block == NULL) { in _dwarf_write_uleb128_alloc()
423 ret |= (-1 << shift); in _dwarf_decode_sleb128()
451 _dwarf_read_string(void *data, Dwarf_Unsigned size, uint64_t *offsetp) in _dwarf_read_string() argument
457 while (*src != '\0' && *offsetp < size) { in _dwarf_read_string()
462 if (*src == '\0' && *offsetp < size) in _dwarf_read_string()
479 _dwarf_write_string_alloc(uint8_t **block, uint64_t *size, uint64_t *offsetp, in _dwarf_write_string_alloc() argument
484 assert(*size > 0); in _dwarf_write_string_alloc()
487 while (*offsetp + len > *size) { in _dwarf_write_string_alloc()
488 *size *= 2; in _dwarf_write_string_alloc()
489 *block = realloc(*block, (size_t) *size); in _dwarf_write_string_alloc()
490 if (*block == NULL) { in _dwarf_write_string_alloc()
496 _dwarf_write_string(*block, offsetp, string); in _dwarf_write_string_alloc()
525 _dwarf_write_block_alloc(uint8_t **block, uint64_t *size, uint64_t *offsetp, in _dwarf_write_block_alloc() argument
529 assert(*size > 0); in _dwarf_write_block_alloc()
531 while (*offsetp + length > *size) { in _dwarf_write_block_alloc()
532 *size *= 2; in _dwarf_write_block_alloc()
533 *block = realloc(*block, (size_t) *size); in _dwarf_write_block_alloc()
534 if (*block == NULL) { in _dwarf_write_block_alloc()
540 _dwarf_write_block(*block, offsetp, blk, length); in _dwarf_write_block_alloc()
557 _dwarf_write_padding_alloc(uint8_t **block, uint64_t *size, uint64_t *offsetp, in _dwarf_write_padding_alloc() argument
560 assert(*size > 0); in _dwarf_write_padding_alloc()
562 while (*offsetp + cnt > *size) { in _dwarf_write_padding_alloc()
563 *size *= 2; in _dwarf_write_padding_alloc()
564 *block = realloc(*block, (size_t) *size); in _dwarf_write_padding_alloc()
565 if (*block == NULL) { in _dwarf_write_padding_alloc()
571 _dwarf_write_padding(*block, offsetp, byte, cnt); in _dwarf_write_padding_alloc()