Commit f2c1bb7
mdbmes
New internal bounded string append APIs (#1816)
To efficiently support JSON serialization with bounded length, this is a new internal string API that can express bounded UTF-8-preserving append operations directly.
This is a prerequisite for work on CDRIVER-3775 (structured logs) and CDRIVER-4814 (performance of large document serialization).
Now a single buffer can be shared by all nesting levels of a complex document. Previously, all nesting levels of a BSON document would allocate their own string append buffer, and truncation happened as a separate step on the way out of these nested levels. Several other temporary string buffers were eliminated, including the temporary buffer that was needed for every printf. Now mcommon_string_append_printf writes directly to the destination, growing it as needed.
* test the utf8-oblivious behavior of bson_string_truncate
* document the utf8-oblivious behavior of bson_string_truncate
* new internal mcommon_string, mcommon_string_append, mcommon_json_append APIs
* some tests for UTF-8 preserving string truncation
* unit test for printf truncation between utf-8 code points
* fix for missing TXT string length validation1 parent a12a612 commit f2c1bb7
File tree
58 files changed
+3233
-2096
lines changed- src
- common/src
- libbson
- doc
- src/bson
- tests
- libmongoc
- src/mongoc
- tests
- mock_server
- unified
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
58 files changed
+3233
-2096
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
0 commit comments