Skip to content

Commit

Permalink
fix: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 committed Jan 24, 2025
1 parent 9bbde4e commit 0630954
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/serde/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1327,12 +1327,12 @@ where
R: Reader<'de>,
T: de::Deserialize<'de>,
{
// check JSON size, because the design of `sonic_rs::Value`, parsing JSON larger than 2 GB is
// check JSON size, because the design of `sonic_rs::Value`, parsing JSON larger than 4 GB is
// not supported
let len = read.as_u8_slice().len();
if len >= (1 << 32) {
return Err(crate::error::make_error(format!(
"Only support JSON less than 2 GB, the input JSON is too large here, len is {len}"
"Only support JSON less than 4 GB, the input JSON is too large here, len is {len}"
)));
}

Expand Down
2 changes: 1 addition & 1 deletion src/value/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub struct Value {
// |str_esc_raw | 6 | *const RawStrHeader (in SharedDom, MUST aligned 8) + *const u8 | |
// | root_node | 7 | *const ShardDom (from Arc, MUST aligned 8) + *const Node (head) | |
//
// NB: we will check the JSON length when parsing, if JSON is > 2GB, will return a error, so we will not check the limits when parsing or using dom.
// NB: we will check the JSON length when parsing, if JSON is >= 4GB, will return a error, so we will not check the limits when parsing or using dom.
#[allow(clippy::box_collection)]
#[repr(C)]
pub(crate) union Data {
Expand Down

0 comments on commit 0630954

Please sign in to comment.