Skip to content

Instantly share code, notes, and snippets.

@jnthn

jnthn/x.diff Secret

Created February 9, 2014 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/da10a4abd2199c91f8a0 to your computer and use it in GitHub Desktop.
Save jnthn/da10a4abd2199c91f8a0 to your computer and use it in GitHub Desktop.
diff --git a/src/6model/serialization.c b/src/6model/serialization.c
index ce3157e..1240376 100644
--- a/src/6model/serialization.c
+++ b/src/6model/serialization.c
@@ -300,7 +300,7 @@ static void get_stable_ref_info(MVMThreadContext *tc, MVMSerializationWriter *wr
/* Expands current target storage as needed. */
static void expand_storage_if_needed(MVMThreadContext *tc, MVMSerializationWriter *writer, MVMint64 need) {
- if (*(writer->cur_write_offset) + need > *(writer->cur_write_limit)) {
+ if (*(writer->cur_write_offset) + need >= *(writer->cur_write_limit)) {
*(writer->cur_write_limit) *= 2;
*(writer->cur_write_buffer) = (char *)realloc(*(writer->cur_write_buffer),
*(writer->cur_write_limit));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment