When you read from a default-constructed MPMCQueue, assert instead of SIGFPE.
authorMartin Martin <mcm@fb.com>
Sat, 12 Nov 2016 00:08:46 +0000 (16:08 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Sat, 12 Nov 2016 00:23:33 +0000 (16:23 -0800)
commit8712f36158b199cb2ffa778304ec181306a5f10d
tree8952aceea8a27957b0d88cd9cc9518ddb58cd2d4
parent1d2d4f326acc0825690c151c38ac92d146b78146
When you read from a default-constructed MPMCQueue, assert instead of SIGFPE.

Summary:
I accidentally forgot to specify the capacity for my
MPMCQueue.  When I then did a blockingRead(), I got a SIGFPE.  Thanks
to a custom signal handler that doesn't print stack traces, and a few
more comedy of errors, I lost a day to this.  With this patch, I would
have gotten an assertion failure instead.

Reviewed By: yfeldblum

Differential Revision: D4169033

fbshipit-source-id: fab97ea0d5afc3c06885758b31a5e8c91ae75a45
folly/MPMCQueue.h