Skip to content

Commit

Permalink
actually, initialize the whole memory block to zero
Browse files Browse the repository at this point in the history
While allocating the object, we might as well initialize the whole memory block to zero in order to protect against hidden issues.
  • Loading branch information
boazsegev authored and ioquatix committed Sep 15, 2020
1 parent f6b1810 commit 0d6adaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/nio4r/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static VALUE NIO_Monitor_allocate(VALUE klass)
if(!monitor)
return Qnil;

monitor->self = Qnil;
*monitor = (struct NIO_Monitor){.self = Qnil};
return Data_Wrap_Struct(klass, NIO_Monitor_mark, NIO_Monitor_free, monitor);
}

Expand Down

0 comments on commit 0d6adaf

Please sign in to comment.