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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
iksemel - XML parser for Rust
Copyright (C) 2024 Süleyman Poyraz
This code is free software; you can redistribute it and/or
modify it under the terms of the Affero General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Affero General Public License for more details.
*/
use cratememory;
/// Aligns a size to the default alignment.
///
/// This function ensures that the given size is aligned to the default
/// alignment boundary, which is based on the size of an f64.
///
/// # Arguments
///
/// * `size` - The size to align
///
/// # Returns
///
/// The aligned size
/// Calculates chunk growth size based on current size and growth factor.
///
/// This function is used to determine the new size when a chunk needs to grow.
/// It applies the growth factor and ensures the result is properly aligned.
///
/// # Arguments
///
/// * `current_size` - The current size of the chunk
///
/// # Returns
///
/// The new size for the chunk
/// Calculates the size needed for escaping a string.
///
/// This function determines how many characters will be needed to escape
/// special XML characters in the input string.
///
/// # Arguments
///
/// * `s` - The string to calculate escape size for
///
/// # Returns
///
/// The number of characters needed to escape the string
/// Calculates the size needed for unescaping a string.
///
/// This function determines how many characters will be needed to unescape
/// XML entities in the input string.
///
/// # Arguments
///
/// * `s` - The string to calculate unescape size for
///
/// # Returns
///
/// The number of characters needed to unescape the string