[PA] Check auto partitioning in PartitionIndexFromAllocToken

Currently, `PartitionIndexFromAllocToken()` can return
`kPointerPartitionIndex` even when `ENABLE_AUTO_PARTITIONING` is
disabled, relying on `Allocator()` to fall back to
`kDefaultPartitionIndex`.

This CL moves the `ENABLE_AUTO_PARTITIONING` check into
`PartitionIndexFromAllocToken()` and guards `kPointerPartitionIndex`
behind the buildflag.

Bug: 549500187, 477186304
Change-Id: I6151e58e378d2a3dc8857e2d14a5078998f3ca87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8506336
Reviewed-by: Mikihito Matsuura <mikt@google.com>
Commit-Queue: Ai Nozaki <ainozaki@google.com>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1709933}
NOKEYCHECK=True
GitOrigin-RevId: a78193eb9893e6be7aa59654a99bd4c42db56be6
2 files changed