Replace globals in "small objects page" with a struct
Replace globals in "small objects page" with a struct

Summary:
Pull Request resolved: https://github.com/facebook/flow/pull/8254

The first page of the shared memory segment contains a bunch of metadata.
Currently these data are manually aligned and stored in a few global variables.

This diff replaces the handful of global variables with a single global variable
pointing to a struct having those data as fields instead.

The fields are aligned either naturally or using the C11 alignas specifier in
the case of atomics. The atomics are over-aligned to 128 bits instead of 64
bits, following folly's Align::hardware_destructive_interference_size [1].

My primary motivation here is primarily simplification. The manual alignment
code was verbose, fragile, and annoying to update. Note in particular the change
in `define_globals` which was littered with (trivial, but noisy) asserts that
are now replaced with a single assert that the struct fits in a single page.

My secondary motivation is to make it easier to add more fields to the first
page of shared memory. Currently, the layout of shared memory is passed to
worker processes out-of-band, along with the file descriptor of the shared file.
Instead, we can store the layout information in this first page and pass workers
only a file descriptor. This way, workers can map the first page to get the
layout info, then use that layout info to make the other mappings.

1. https://github.com/facebook/folly/blob/09634ef57a35013feb3d0d44ae89f06a4c4c1458/folly/lang/Align.h#L122

Reviewed By: jbrown215

Differential Revision: D19270407

fbshipit-source-id: 7a2f11a057aca545b5dc1c44092ae05dec4b03b3

nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow