Skip to content

Commit

Permalink
Adds a comment to _cbor_builder_append mentioning its invariant
Browse files Browse the repository at this point in the history
  • Loading branch information
James-ZHANG authored and PJK committed Dec 3, 2022
1 parent 2ab0d05 commit ff66e8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cbor/internal/builder_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "../tags.h"
#include "unicode.h"

// This function maintains the invariant that no memory reachable by ctx->stack
// and item would be leaked.
void _cbor_builder_append(cbor_item_t *item,
struct _cbor_decoder_context *ctx) {
if (ctx->stack->size == 0) {
Expand Down

0 comments on commit ff66e8c

Please sign in to comment.