Commit 3e3407af authored by Joshua Haberman's avatar Joshua Haberman

Re-add memset() that seemed redundant but is necessary in case of GC.

parent b9131f0a
......@@ -70,6 +70,9 @@ VALUE Message_alloc(VALUE klass) {
msg = (MessageHeader*)ALLOC_N(uint8_t,
sizeof(MessageHeader) + desc->layout->size);
// Required in case a GC happens before layout_init().
memset(msg, 0, desc->layout->size);
// We wrap first so that everything in the message object is GC-rooted in case
// a collection happens during object creation in layout_init().
ret = TypedData_Wrap_Struct(klass, &Message_type, msg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment