Changelog History
Page 3
-
v2.3.0 Changes
June 15, 2024What's Changed
- 📜 CSVField: new member function try_parse_decimal() to specify one or more decimal symbols by @wilfz in #226
- 🏁 Replace the includes of Windows.h with windows.h (#204) by @ludovicdelfau in #235
- 📜 Use const CSVFormat& in calculate_score by @rajgoel in #236
- 🛠 Fix memory issues in CSVFieldList by @vincentlaucsb in #237
Race Condition Notes
Background
📜 The CSV Parser tries to perform as few allocations as possible. Instead of naively storing individual CSV fields as singular
std::strings in astd::vector, the parser keeps references to the raw input and uses lightweightRawCSVFieldobjects to mark where a specific field starts and ends in that field (as well as flag indicating if an escaped quote is present). This has the benefits of:- Avoiding the cost of constructing many
std::stringinstances - Avoiding the cost of constant
std::vectorreallocations - Preserving locality of reference
📜 Furthermore, the CSV Parser also uses separate threads for parsing CSV and for iterating over the data. As CSV rows are parsed, they are made available to the user who may utilize them without interrupting the parsing of new rows.
The Race Condition
The
RawCSVFieldobjects mentioned previously were stored as contiguous blocks, and anstd::vectorof pointers to these blocks were used to keep track of them.📜 However, as @ludovicdelfau accurately diagnosed, if the reading thread attempted to access a
RawCSVField(e.g. through reading aCSVField) at the same time that a parsing thread was pushing a newRawCSVFieldto an at-capacitystd::vector, the parsing thread's push would cause the contents of thestd::vectorto be reallocated, thus causing the reading thread to access deallocated memory.📜 This issue was first reported in #217.
The Fix
👌 The fix was simple. An
std::dequewas dropped in to replacestd::vectorto storeRawCSVFieldpointers, asstd::dequedoes not perform reallocations. This change appears to even improve the CSV Parser's performance as the cost of constant reallocations is avoided. The loss of memory locality typical instd::dequeapplications was avoided as, again, the CSV Parser is storing pointers toRawCSVField[]and not theRawCSVFieldobjects themselves.🆕 New Contributors
- 📜 @wilfz made their first contribution in #226
- 📜 @ludovicdelfau made their first contribution in #235
- 📜 @rajgoel made their first contribution in #236
Full Changelog : 2.2.3...2.3.0
-
v2.2.3 Changes
May 26, 2024🛠 Fix
n_rows()being off-by-one when theCSVReaderiterator was used (reported in #173)- Note : This was due to a simple counting error where the iterator did not increment the row counter for the first row. All rows were still correctly read.
📜 Implement ability to handle arbitrary combinations of
\rand\nin line endings (#223)🛠 Fix CSV writers incorrectly converting decimal values between 0 and -1 to positive numbers
-
v2.2.2 Changes
May 20, 2024What's Changed
- 👍 Allow parsing of numbers that begin with
+, fixing #213 - 📜 Fix compiler warnings in g++ from using
absand intry_parse_hex()#227 🛠 Fix invalid memory access issue in g++ builds #228
- Issue was caused when using
CSVFieldmethods in conjunction withCSVRowreverse iterators
- Issue was caused when using
🏗 CMake options to disable programs building by @BaptisteLemarcis in #148
🆕 New Contributors
- 📜 @BaptisteLemarcis made their first contribution in #148
Full Changelog : 2.2.1...2.2.2
- 👍 Allow parsing of numbers that begin with
-
v2.2.1 Changes
May 18, 2024📜 This is a simple CMake change that makes it easier to
#include "csv.hpp"in a CMake project that grabscsv-parserusingFetchContent_Declare().What's Changed
🆕 New Contributors
Full Changelog : 2.2.0...2.2.1
-
v2.2.0 Changes
April 03, 2024🛠 Fixed bug which caused inaccurate serialization of floating point values in CSV Writer as reported by #188
- Bug affected numbers close to 10 n; was caused by usage of inaccurate
std::log()function (see: https://stackoverflow.com/questions/1489830/efficient-way-to-determine-number-of-digits-in-an-integer)
- Bug affected numbers close to 10 n; was caused by usage of inaccurate
🛠 Fixed issue where strings consisting of numbers and dashes (e.g. phone numbers) were inaccurately identified as integers
⚠ Silenced some compiler warnings
-
v2.1.3 Changes
July 29, 2021- 🛠 Fix various compatibility issues with g++ and clang
- ➕ Added hex value parsing
- 🛠 Fixed a rare out-of-bounds condition
-
v2.1.2 Changes
July 27, 2021🛠 Fixed compilation issues with C++11 and 14.
- CSV Parser should now be should C++11 compatible once again with g++ 7.5 or up
👍 Allowed users to customize decimal place precision when writing CSVs
🛠 Fixed floating point output
- Arbitrarily large integers stored in doubles can now be output w/o limits
🛠 Fixed newlines not being escaped by
CSVWriter
-
v2.1.1 Changes
April 15, 2021- 🛠 Fixed CSVStats only processing first 5000 rows thanks to @TobyEalden
- 🛠 Fixed parsing """fields like this""" thanks to @rpadrela
- 🛠 Fixed CSVReader move semantics thanks to @artpaul