1 // Copyright 2021 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_ALLOCATOR_EARLY_ZONE_REGISTRATION_APPLE_H_ 6 #define BASE_ALLOCATOR_EARLY_ZONE_REGISTRATION_APPLE_H_ 7 8 // This is an Apple-only file, used to register PartitionAlloc's zone *before* 9 // the process becomes multi-threaded. 10 11 namespace partition_alloc { 12 13 // Must be called *once*, *before* the process becomes multi-threaded. 14 void EarlyMallocZoneRegistration(); 15 16 // Tricks the registration code to believe that PartitionAlloc was not already 17 // registered. This allows a future library load to register PartitionAlloc's 18 // zone as well, rather than bailing out. 19 // 20 // This is mutually exclusive with EarlyMallocZoneRegistration(), and should 21 // ideally be removed. Indeed, by allowing two zones to be registered, we still 22 // end up with a split heap, and more memory usage. 23 // 24 // This is a hack for https://crbug.com/1274236. 25 void AllowDoublePartitionAllocZoneRegistration(); 26 27 } // namespace partition_alloc 28 29 #endif // BASE_ALLOCATOR_EARLY_ZONE_REGISTRATION_APPLE_H_ 30