mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 00:04:10 -08:00
Fix max heap size and hugeAlloc
This commit is contained in:
parent
07293886db
commit
2fcaaa5313
|
@ -439,8 +439,7 @@ public class WasmGCTarget implements TeaVMTarget, TeaVMWasmGCHost {
|
||||||
|
|
||||||
if (enableDirectMallocSupport) {
|
if (enableDirectMallocSupport) {
|
||||||
var minPages = (memorySize - 1) / WasmHeap.PAGE_SIZE + 1;
|
var minPages = (memorySize - 1) / WasmHeap.PAGE_SIZE + 1;
|
||||||
var maxPages = (memorySize - directMallocMinHeapSize + directMallocMaxHeapSize - 1)
|
var maxPages = (memorySize + directMallocMaxHeapSize - WasmHeap.PAGE_SIZE - 1) / WasmHeap.PAGE_SIZE + 1;
|
||||||
/ WasmHeap.PAGE_SIZE + 1;
|
|
||||||
module.setMinMemorySize(minPages);
|
module.setMinMemorySize(minPages);
|
||||||
module.setMaxMemorySize(maxPages);
|
module.setMaxMemorySize(maxPages);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -283,7 +283,7 @@ public final class LaxMalloc {
|
||||||
allocateMemoryFromChunk(addrIterator, chunkSize, sizeBytes);
|
allocateMemoryFromChunk(addrIterator, chunkSize, sizeBytes);
|
||||||
|
|
||||||
// +4 bytes to skip size int
|
// +4 bytes to skip size int
|
||||||
Address ret = chunkPtr.add(4);
|
Address ret = addrIterator.add(4);
|
||||||
|
|
||||||
// clear if requested
|
// clear if requested
|
||||||
if (cleared) {
|
if (cleared) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user