[
https://issues.apache.org/jira/browse/AVRO-3758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17722020#comment-17722020
]
ASF subversion and git services commented on AVRO-3758:
-------------------------------------------------------
Commit 0674b690c930b94dccf4fd939e794431d5ef3116 in avro's branch
refs/heads/branch-1.11 from Martin Grigorov
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=0674b690c ]
AVRO-3758: [Rust] use atomic types instead of static mut (#2225)
* AVRO-3758: [Rust] Use AtomicXyz types instead of static mutable ones
Use AtomicBool for apache_avro::util::SERDE_HUMAN_READABLE
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
* AVRO-3758: [Rust] Use AtomicXyz types instead of static mutable ones
Use AtomicUsize for apache_avro::util::MAX_ALLOCATION_BYTES
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
---------
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
(cherry picked from commit b86c63baeff4ef4a08c2559913d6e7c9d40d95b9)
> [Rust] Use AtomicXyz types instead of static mutable ones
> ---------------------------------------------------------
>
> Key: AVRO-3758
> URL: https://issues.apache.org/jira/browse/AVRO-3758
> Project: Apache Avro
> Issue Type: Improvement
> Components: rust
> Reporter: Martin Tzvetanov Grigorov
> Assignee: Martin Tzvetanov Grigorov
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> apache_avro::util uses "static mut" for MAX_ALLOCATION_BYTES and
> SERDE_HUMAN_READABLE. Because of this it has to use "unsafe {}" blocks to
> update their values.
>
> It would be cleaner to use AtomicBool/AtomicUsize instead and get rid of the
> unsafe blocks.
>
> Suggested at https://github.com/apache/avro/pull/2202#issuecomment-1542887124
--
This message was sent by Atlassian Jira
(v8.20.10#820010)