Mallctl stress test: fix a type.

The mallctlbymib_long helper was copy-pasted from mallctlbymib_short, and
incorrectly used its output variable (a char *) rather than the output variable
of the mallctl call it was using (a uint64_t), causing breakages when
sizeof(char *) differed from sizeof(uint64_t).
This commit is contained in:
David Goldblatt 2020-08-17 09:04:33 -07:00 committed by David Goldblatt
parent 753bbf1849
commit b0ffa39cac

View File

@ -44,9 +44,9 @@ size_t mib_long[6];
static void static void
mallctlbymib_long(void) { mallctlbymib_long(void) {
size_t miblen = sizeof(mib_long)/sizeof(mib_long[0]); size_t miblen = sizeof(mib_long)/sizeof(mib_long[0]);
const char *version; uint64_t nmalloc;
size_t sz = sizeof(version); size_t sz = sizeof(nmalloc);
int err = mallctlbymib(mib_long, miblen, &version, &sz, NULL, 0); int err = mallctlbymib(mib_long, miblen, &nmalloc, &sz, NULL, 0);
assert_d_eq(err, 0, "mallctlbymib failure"); assert_d_eq(err, 0, "mallctlbymib failure");
} }