Avoid "immortal" dynamic memory allocations.

Statically allocating the storage and then lazily constructing the objects
(in onces) avoids global constructors and the false positives (thanks,
Valgrind) about memory leaks at program termination.

Fixes #28, #190, #377, #387.

Change-Id: I5b3eaf5d743a4723212c5a7461c280d99a0384ac
Reviewed-on: https://code-review.googlesource.com/c/re2/+/60850
Reviewed-by: Perry Lorier <perryl@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
2 files changed