summaryrefslogtreecommitdiffstats
path: root/layout.h
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-06-15 15:44:39 +0200
committerNico Huber <nico.h@gmx.de>2021-06-26 15:53:31 +0000
commit7ebd578100e6526ef46c98cb9978d692160d8179 (patch)
treef87dc8068f97aa101ae4151dba40a9fd7dc77273 /layout.h
parent06a89d713951a2e08ef8fb698a7688357baa83d1 (diff)
downloadflashrom-7ebd578100e6526ef46c98cb9978d692160d8179.tar.gz
flashrom-7ebd578100e6526ef46c98cb9978d692160d8179.tar.bz2
flashrom-7ebd578100e6526ef46c98cb9978d692160d8179.zip
layout: Add `capacity` field
Use it to keep track of the size of the `entries` array. An interim solution until we have dynamic allocation. Change-Id: Ib5f431bc0a72a79a53fa1376c3417942b19dd3a0 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33516 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'layout.h')
-rw-r--r--layout.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/layout.h b/layout.h
index d60c89ee3..2a0f8697c 100644
--- a/layout.h
+++ b/layout.h
@@ -46,6 +46,8 @@ struct romentry {
struct flashrom_layout {
/* entries store the entries specified in a layout file and associated run-time data */
struct romentry *entries;
+ /* the maximum number of entries */
+ size_t capacity;
/* the number of successfully parsed entries */
size_t num_entries;
};