mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-13 21:40:43 +00:00
Patch the test for now to work with 16K pages
This exposes a bug in CodeAllocator that needs to be fixed properly
This commit is contained in:
parent
71df988dec
commit
6c708975d3
1 changed files with 6 additions and 4 deletions
|
@ -41,8 +41,8 @@ TEST_CASE("CodeAllocation")
|
|||
|
||||
TEST_CASE("CodeAllocationFailure")
|
||||
{
|
||||
size_t blockSize = 4096;
|
||||
size_t maxTotalSize = 8192;
|
||||
size_t blockSize = 16384;
|
||||
size_t maxTotalSize = 32768;
|
||||
CodeAllocator allocator(blockSize, maxTotalSize);
|
||||
|
||||
uint8_t* nativeData;
|
||||
|
@ -50,11 +50,13 @@ TEST_CASE("CodeAllocationFailure")
|
|||
uint8_t* nativeEntry;
|
||||
|
||||
std::vector<uint8_t> code;
|
||||
code.resize(6000);
|
||||
code.resize(18000);
|
||||
|
||||
// allocation has to fit in a block
|
||||
REQUIRE(!allocator.allocate(nullptr, 0, code.data(), code.size(), nativeData, sizeNativeData, nativeEntry));
|
||||
|
||||
code.resize(3000);
|
||||
// each allocation exhausts a block, so third allocation fails
|
||||
code.resize(10000);
|
||||
REQUIRE(allocator.allocate(nullptr, 0, code.data(), code.size(), nativeData, sizeNativeData, nativeEntry));
|
||||
REQUIRE(allocator.allocate(nullptr, 0, code.data(), code.size(), nativeData, sizeNativeData, nativeEntry));
|
||||
REQUIRE(!allocator.allocate(nullptr, 0, code.data(), code.size(), nativeData, sizeNativeData, nativeEntry));
|
||||
|
|
Loading…
Reference in a new issue