| 89 | |
| 90 | template <> |
| 91 | inline uint32_t ByteReader::ReadValue(uint8_t bytes, uint8_t trailing_zero) { |
| 92 | uint32_t result = 0; |
| 93 | switch (bytes) { |
| 94 | case 0: |
| 95 | if (trailing_zero < 8) { |
| 96 | result = Load<uint32_t>(buffer + index); |
| 97 | index += sizeof(uint32_t); |
| 98 | return result; |
| 99 | } |
| 100 | return result; |
| 101 | case 1: |
| 102 | result = Load<uint8_t>(buffer + index); |
| 103 | index++; |
| 104 | return result; |
| 105 | case 2: |
| 106 | result = Load<uint16_t>(buffer + index); |
| 107 | index += 2; |
| 108 | return result; |
| 109 | case 3: |
| 110 | memcpy(&result, (void*)(buffer + index), 3); |
| 111 | index += 3; |
| 112 | return result; |
| 113 | case 4: |
| 114 | result = Load<uint32_t>(buffer + index); |
| 115 | index += 4; |
| 116 | return result; |
| 117 | default: |
| 118 | throw InternalException("Write of %llu bytes attempted into address pointing to 4 byte value", bytes); |
| 119 | } |
| 120 | } |
| 121 | } // namespace alp_bench |
nothing calls this directly
no test coverage detected