andrzej-kaczmarek commented on code in PR #3365:
URL: https://github.com/apache/mynewt-core/pull/3365#discussion_r1965339167


##########
sys/log/full/include/log/log_fcb.h:
##########
@@ -103,19 +111,34 @@ struct fcb_log {
  * the log is walked, the starting point of the walk is added to the set of
  * bookmarks.
  *
- * FCB rotation invalidates all bookmarks.  It is up to the client code to
+ * FCB rotation invalidates all bookmarks. It is up to the client code to
  * clear a log's bookmarks whenever rotation occurs.
  */
 
 /**
  * @brief Configures an fcb_log to use the specified buffer for bookmarks.
+ *        If sector bookmarks are enabled, buffer should be big enough
+ *        to accomodate bookmarks for the entire flash area that is allocated
+ *        for the FCB log, i,e; sizeof(struct log_fcb_bmark) *
+ *        my_log.fl_fcb.f_sector_cnt + MYNEWT_VAL(LOG_FCB_NUM_ABS_BOOKMARKS)

Review Comment:
   It can't stay like this. The function should return an error if buffer is 
too small and not just crash later on. But actually it would be better if it 
can work with smaller buffers as well and e.g. place bookmark every n-th sector 
or just skip bookmarks that don't fit in the buffer.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to