From 1dd9f1900fca0c137324c05a9421f1ba180b2470 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Mon, 18 Aug 2014 20:09:52 +0300 Subject: Change the _count fields to use pb_size_t datatype. Update issue 82 Status: FixedInGit --- docs/migration.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/migration.rst') diff --git a/docs/migration.rst b/docs/migration.rst index 9d41f5b1..800bc1f9 100644 --- a/docs/migration.rst +++ b/docs/migration.rst @@ -31,6 +31,21 @@ functionality is not needed. **Error indications:** Linker error: undefined reference to *pb_field_iter_begin*, *pb_field_iter_next* or similar. +Change data type of field counts to pb_size_t +--------------------------------------------- +**Rationale:** Often nanopb is used with small arrays, such as 255 items or +less. Using a full *size_t* field to store the array count wastes memory if +there are many arrays. There already exists parameters *PB_FIELD_16BIT* and +*PB_FIELD_32BIT* which tell nanopb what is the maximum size of arrays in use. + +**Changes:** Generator will now use *pb_size_t* for the array *_count* fields. +The size of the type will be controlled by the *PB_FIELD_16BIT* and +*PB_FIELD_32BIT* compilation time options. + +**Required actions:** Regenerate all *.pb.h* files. In some cases casts to the +*pb_size_t* type may need to be added in the user code when accessing the +*_count* fields. + Nanopb-0.2.9 (2014-08-09) ========================= -- cgit 1.2.3-korg