memory_unittest_mac.h 1014 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (c) 2010 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // This file contains helpers for the process_util_unittest to allow it to fully
  5. // test the Mac code.
  6. #ifndef BUTIL_PROCESS_MEMORY_UNITTEST_MAC_H_
  7. #define BUTIL_PROCESS_MEMORY_UNITTEST_MAC_H_
  8. #include "butil/basictypes.h"
  9. namespace butil {
  10. // Allocates memory via system allocators. Alas, they take a _signed_ size for
  11. // allocation.
  12. void* AllocateViaCFAllocatorSystemDefault(ssize_t size);
  13. void* AllocateViaCFAllocatorMalloc(ssize_t size);
  14. void* AllocateViaCFAllocatorMallocZone(ssize_t size);
  15. #if !defined(ARCH_CPU_64_BITS)
  16. // See process_util_unittest_mac.mm for an explanation of why this function
  17. // isn't implemented for the 64-bit environment.
  18. // Allocates a huge Objective C object.
  19. void* AllocatePsychoticallyBigObjCObject();
  20. #endif // !ARCH_CPU_64_BITS
  21. } // namespace butil
  22. #endif // BUTIL_PROCESS_MEMORY_UNITTEST_MAC_H_