⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286773 in webkit


Ignore:
Timestamp:
Dec 9, 2021, 3:23:27 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[libpas] Fix up missing header includes and build guards in unit tests
https://bugs.webkit.org/show_bug.cgi?id=234007

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-12-09
Reviewed by Yusuke Suzuki.

Add missing header inclusions in different libpas unit test sources
to avoid build problems.

In IsoHeapChaosTests.cpp, Mach-specific thread-related header inclusion
and usage is put inside PAS_OS(DARWIN) build guards. On Linux, the
enumerator sub-tests that utilize this thread suspension and resuming
functionality are disabled.

  • libpas/src/test/ExpendableMemoryTests.cpp:
  • libpas/src/test/IsoHeapChaosTests.cpp:

(std::testAllocationChaos):

  • libpas/src/test/IsoHeapPageSharingTests.cpp:
  • libpas/src/test/IsoHeapPartialAndBaselineTests.cpp:
  • libpas/src/test/RaceTests.cpp:
  • libpas/src/test/TestHarness.cpp:
  • libpas/src/test/ThingyAndUtilityHeapAllocationTests.cpp:
Location:
trunk/Source/bmalloc
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/bmalloc/ChangeLog

    r286670 r286773  
     12021-12-09  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [libpas] Fix up missing header includes and build guards in unit tests
     4        https://bugs.webkit.org/show_bug.cgi?id=234007
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Add missing header inclusions in different libpas unit test sources
     9        to avoid build problems.
     10
     11        In IsoHeapChaosTests.cpp, Mach-specific thread-related header inclusion
     12        and usage is put inside PAS_OS(DARWIN) build guards. On Linux, the
     13        enumerator sub-tests that utilize this thread suspension and resuming
     14        functionality are disabled.
     15
     16        * libpas/src/test/ExpendableMemoryTests.cpp:
     17        * libpas/src/test/IsoHeapChaosTests.cpp:
     18        (std::testAllocationChaos):
     19        * libpas/src/test/IsoHeapPageSharingTests.cpp:
     20        * libpas/src/test/IsoHeapPartialAndBaselineTests.cpp:
     21        * libpas/src/test/RaceTests.cpp:
     22        * libpas/src/test/TestHarness.cpp:
     23        * libpas/src/test/ThingyAndUtilityHeapAllocationTests.cpp:
     24
    1252021-12-08  Zan Dobersek  <zdobersek@igalia.com>
    226
  • trunk/Source/bmalloc/libpas/src/test/ExpendableMemoryTests.cpp

    r285789 r286773  
    2929
    3030#include "bmalloc_heap.h"
     31#include <condition_variable>
     32#include <mutex>
    3133#include "pas_compact_expendable_memory.h"
    3234#include "pas_large_expendable_memory.h"
  • trunk/Source/bmalloc/libpas/src/test/IsoHeapChaosTests.cpp

    r285789 r286773  
    4141#include "jit_heap.h"
    4242#include "jit_heap_config.h"
    43 #include <mach/thread_act.h>
    4443#include <map>
    4544#include "minalign32_heap.h"
    4645#include "minalign32_heap_config.h"
     46#include <mutex>
    4747#include "pagesize64k_heap.h"
    4848#include "pagesize64k_heap_config.h"
     
    6363#include <vector>
    6464#include <thread>
     65
     66#if PAS_OS(DARWIN)
     67#include <mach/thread_act.h>
     68#endif
    6569
    6670using namespace std;
     
    611615            }
    612616           
     617#if PAS_OS(DARWIN)
    613618            for (pthread_t thread : runningThreads) {
    614619                kern_return_t result = thread_suspend(pthread_mach_thread_np(thread));
    615620                PAS_ASSERT(result == KERN_SUCCESS);
    616621            }
     622#endif
    617623
    618624            pageRanges.clear();
     
    807813                cout << "    Did " << numEnumerations << " enumerations.\n";
    808814           
     815#if PAS_OS(DARWIN)
    809816            for (pthread_t thread : runningThreads) {
    810817                kern_return_t result = thread_resume(pthread_mach_thread_np(thread));
    811818                PAS_ASSERT(result == KERN_SUCCESS);
    812819            }
     820#endif
    813821
    814822            lock.unlock();
     
    928936void addTheTests(unsigned multiplier, bool testEnumerator)
    929937{
     938#if PAS_OS(LINUX)
     939    // FIXME: thread suspension/resume in libpas, required for enumerator tests, is missing on Linux
     940    // http://webkit.org/b/234071
     941    testEnumerator = false;
     942#endif
     943
    930944    ADD_TEST(testAllocationChaos(1, 0, 1000 * multiplier, 1000000 * multiplier, uniformlyRandomUpTo5000, 10000000 * multiplier, false));
    931945    ADD_TEST(testAllocationChaos(1, 10, 1000 * multiplier, 500000 * multiplier, sometimesSmallSometimesBig, 10000000 * multiplier, false));
  • trunk/Source/bmalloc/libpas/src/test/IsoHeapPageSharingTests.cpp

    r286573 r286773  
    3030#include "HeapLocker.h"
    3131#include "LargeSharingPoolDump.h"
     32#include <condition_variable>
    3233#include <functional>
    3334#include "iso_heap.h"
    3435#include "iso_heap_config.h"
    3536#include "iso_heap_innards.h"
     37#include <mutex>
    3638#include "pas_all_heaps.h"
    3739#include "pas_baseline_allocator_table.h"
  • trunk/Source/bmalloc/libpas/src/test/IsoHeapPartialAndBaselineTests.cpp

    r286573 r286773  
    3333#include "iso_test_heap.h"
    3434#include "iso_test_heap_config.h"
     35#include <mutex>
    3536#include "pas_baseline_allocator_table.h"
    3637#include "pas_heap.h"
  • trunk/Source/bmalloc/libpas/src/test/RaceTests.cpp

    r282556 r286773  
    2525
    2626#include "TestHarness.h"
     27#include <condition_variable>
    2728#include <functional>
    2829#include "iso_heap.h"
  • trunk/Source/bmalloc/libpas/src/test/TestHarness.cpp

    r286516 r286773  
    2727
    2828#include "Verifier.h"
     29#include <atomic>
    2930#include "iso_heap_config.h"
    3031#include "iso_test_heap_config.h"
  • trunk/Source/bmalloc/libpas/src/test/ThingyAndUtilityHeapAllocationTests.cpp

    r286493 r286773  
    3333#include <functional>
    3434#include <map>
     35#include <mutex>
    3536#include "pas_all_heaps.h"
    3637#include "pas_baseline_allocator_table.h"
Note: See TracChangeset for help on using the changeset viewer.