summaryrefslogtreecommitdiff
path: root/absl/synchronization/notification.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-11-07 10:31:02 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2022-11-07 10:31:46 -0800
commit4ed8e46f1b2e13da2dd158159b27d2ba0e65ae15 (patch)
treeb6f27df20a9339c44878a94b41507ebbdf1a8df3 /absl/synchronization/notification.h
parent1ee0ea84893e7d1edfc4fdaf192a0551a46e20b4 (diff)
Force a conservative allocation for pointers to methods in Condition objects.
In order for Condition to work on Microsoft platforms, it has to store pointers to methods that are larger than we usually expect. MSVC pointers to methods from class hierarchies that employ multiple inheritance or virtual inheritance are strictly larger than pointers to methods in class hierarchies that only employ single inheritance. This change introduces an opaque declaration of a class, which is not fulfilled. This declaration is used to calculate the size of the Condition method pointer allocation. Because the declaration is of unspecified inheritance, the compiler is forced to use a conservatively large allocation, which will thereby accommodate all method pointer sizes. Because the `method_` and `function_` callbacks are only populated in mutually exclusive conditions, they can be allowed to take up the same space in the Condition object. This change combines the `method_` and `function_` fields and renames the new field to `callback_`. The constructor logic is updated to reflect the new field. PiperOrigin-RevId: 486701312 Change-Id: If06832cc26f27d91e295183e44dc29440af5f9db
Diffstat (limited to 'absl/synchronization/notification.h')
0 files changed, 0 insertions, 0 deletions