CARVIEW |
Select Language
HTTP/2 200
date: Mon, 21 Jul 2025 19:09:21 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/aeron-io/simple-binary-encoding.git
etag: W/"fd239ddf4862ccbd8ec1a1e091961756"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=pzH199BDm12ph3FsMZU%2BOQwfaS069Jve%2B0kL9jx%2BAEGxZHm0sHGMJeVaJX0TijKBwTf6QBOqih2f1nOu6jZ9ofu9JB1Dp9uecEv4eIrFBsxcCUtKeOumMqt7IY%2BgGVQh74itb8xyXpo6rzqDdi6u76H88otKee8n3d05%2FeIR2LalEvrAuxAeB9acBLiLg6rXgyjFyiqNuj%2BYog1sOAfhU8Jjj%2Fo2HtJRb%2BQRD3x4hJAy75saddE1W8VMoaXX5pSGXPWAVMqEl2DTZVXQbfzztg%3D%3D--yIZ5ax3fWEf8ehgk--PV2p16Ab4s%2B%2FDXxDwP8%2BpA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.832177902.1753124960; Path=/; Domain=github.com; Expires=Tue, 21 Jul 2026 19:09:20 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 21 Jul 2026 19:09:20 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: AE76:2CF407:288246:3051B8:687E9060
Std span (#1038) · aeron-io/simple-binary-encoding@ec42a79 · GitHub
Copy file name to clipboardExpand all lines: sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java
Copy file name to clipboardExpand all lines: sbe-tool/src/test/cpp/CMakeLists.txt
Copy file name to clipboardExpand all lines: sbe-tool/src/test/cpp/CodeGenTest.cpp
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 542
Commit ec42a79
Std span (#1038)
* [C++] Integrate std::span support for flyweight API
The impetus was a bug that we ran into when writing a string-literal to a fixed-width char field:
```c++
flyweight.putFixedChar("hello");
```
This is unsafe:
- If the field size is less than 6, we overrun the buffer and corrupt it.
- If the field size is more than 6, we don't zero pad the rest of it.
Instead, we build on support for the std::string_view getters and setters, which do length checking.
std::span generalizes this to fixed-width fields of all types. Notably, if the size of the std::span
is knowable at compile time, we pay no runtime cost for the length checking, and we should get
similar performance to the existing API which takes a raw pointer.
Further, we add a sbetool option to disable accepting arrays by raw pointer, which should prevent
memcpy operation without bounds checking. This is off by default to avoid a breaking change.
* [C++] hide USE_SPAN behind ENABLE_SPAN
* [C++] add macro guards
---------
Co-authored-by: Matt Stern <stern@pdtpartners.com>1 parent 1d6e3f1 commit ec42a79Copy full SHA for ec42a79
File tree
Expand file treeCollapse file tree
3 files changed
+207
-6
lines changedFilter options
- sbe-tool/src
- main/java/uk/co/real_logic/sbe/generation/cpp
- test/cpp
Expand file treeCollapse file tree
3 files changed
+207
-6
lines changedsbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java
Copy file name to clipboardExpand all lines: sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java+133-5Lines changed: 133 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| 52 | + | |
| 53 | + | |
52 | 54 |
| |
53 | 55 |
| |
54 | 56 |
| |
| |||
1634 | 1636 |
| |
1635 | 1637 |
| |
1636 | 1638 |
| |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
1637 | 1656 |
| |
1638 | 1657 |
| |
1639 | 1658 |
| |
| |||
1703 | 1722 |
| |
1704 | 1723 |
| |
1705 | 1724 |
| |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
1706 | 1728 |
| |
1707 | 1729 |
| |
1708 | 1730 |
| |
1709 | 1731 |
| |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
1710 | 1739 |
| |
1711 | 1740 |
| |
1712 | 1741 |
| |
| |||
2258 | 2287 |
| |
2259 | 2288 |
| |
2260 | 2289 |
| |
2261 |
| - | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
2262 | 2311 |
| |
| 2312 | + | |
2263 | 2313 |
| |
2264 |
| - | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
2265 | 2319 |
| |
2266 |
| - | |
| 2320 | + | |
| 2321 | + | |
2267 | 2322 |
| |
2268 | 2323 |
| |
2269 | 2324 |
| |
| |||
2272 | 2327 |
| |
2273 | 2328 |
| |
2274 | 2329 |
| |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
2275 | 2403 |
| |
2276 | 2404 |
| |
2277 | 2405 |
| |
| |||
2332 | 2460 |
| |
2333 | 2461 |
| |
2334 | 2462 |
| |
2335 |
| - | |
| 2463 | + | |
2336 | 2464 |
| |
2337 | 2465 |
| |
2338 | 2466 |
| |
| |||
2354 | 2482 |
| |
2355 | 2483 |
| |
2356 | 2484 |
| |
2357 |
| - | |
| 2485 | + | |
2358 | 2486 |
| |
2359 | 2487 |
| |
2360 | 2488 |
| |
|
sbe-tool/src/test/cpp/CMakeLists.txt
Copy file name to clipboardExpand all lines: sbe-tool/src/test/cpp/CMakeLists.txt+12-1Lines changed: 12 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
103 | 103 |
| |
104 | 104 |
| |
105 | 105 |
| |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
106 | 111 |
| |
107 | 112 |
| |
108 | 113 |
| |
| |||
111 | 116 |
| |
112 | 117 |
| |
113 | 118 |
| |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
114 | 124 |
| |
115 | 125 |
| |
116 | 126 |
| |
117 |
| - | |
| 127 | + | |
118 | 128 |
| |
119 | 129 |
| |
120 | 130 |
| |
| 131 | + | |
121 | 132 |
| |
122 | 133 |
|
sbe-tool/src/test/cpp/CodeGenTest.cpp
Copy file name to clipboardExpand all lines: sbe-tool/src/test/cpp/CodeGenTest.cpp+62Lines changed: 62 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1083 | 1083 |
| |
1084 | 1084 |
| |
1085 | 1085 |
| |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + |
You can’t perform that action at this time.
0 commit comments