Reads the next size pair in a multi-sized option. */
| 777 | |
| 778 | /* Reads the next size pair in a multi-sized option. */ |
| 779 | static bool |
| 780 | malloc_conf_multi_sizes_next(const char **slab_size_segment_cur, |
| 781 | size_t *vlen_left, size_t *slab_start, size_t *slab_end, size_t *new_size) { |
| 782 | const char *cur = *slab_size_segment_cur; |
| 783 | char *end; |
| 784 | uintmax_t um; |
| 785 | |
| 786 | set_errno(0); |
| 787 | |
| 788 | /* First number, then '-' */ |
| 789 | um = malloc_strtoumax(cur, &end, 0); |
| 790 | if (get_errno() != 0 || *end != '-') { |
| 791 | return true; |
| 792 | } |
| 793 | *slab_start = (size_t)um; |
| 794 | cur = end + 1; |
| 795 | |
| 796 | /* Second number, then ':' */ |
| 797 | um = malloc_strtoumax(cur, &end, 0); |
| 798 | if (get_errno() != 0 || *end != ':') { |
| 799 | return true; |
| 800 | } |
| 801 | *slab_end = (size_t)um; |
| 802 | cur = end + 1; |
| 803 | |
| 804 | /* Last number */ |
| 805 | um = malloc_strtoumax(cur, &end, 0); |
| 806 | if (get_errno() != 0) { |
| 807 | return true; |
| 808 | } |
| 809 | *new_size = (size_t)um; |
| 810 | |
| 811 | /* Consume the separator if there is one. */ |
| 812 | if (*end == '|') { |
| 813 | end++; |
| 814 | } |
| 815 | |
| 816 | *vlen_left -= end - *slab_size_segment_cur; |
| 817 | *slab_size_segment_cur = end; |
| 818 | |
| 819 | return false; |
| 820 | } |
| 821 | |
| 822 | static bool |
| 823 | malloc_conf_next(char const **opts_p, char const **k_p, size_t *klen_p, |
no test coverage detected