Commit edb61db
committed
Allow users to specify Packer internal buf_size
Giving this flexibility to users means that internal reallocations can
be avoided if the buffer size is good enough, at the expense of
potentially allocating more memory than needed. This, together with
reusing a Packer object, means that multiple serialisations can end up
requiring no memory allocations other than the initial buffer creation,
which can be a big win in some situations.
The default value is still 1MB, making this backwards compatible.
Signed-off-by: Rodrigo Tobar <[email protected]>1 parent c8d0751 commit edb61db
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| |||
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
115 | | - | |
116 | | - | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| |||
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
125 | | - | |
| 129 | + | |
126 | 130 | | |
127 | 131 | | |
128 | 132 | | |
| |||
0 commit comments