diff --git a/interop/core/src/main/java/org/teavm/interop/DirectMalloc.java b/interop/core/src/main/java/org/teavm/interop/DirectMalloc.java index f26ab0c49..b605abb92 100644 --- a/interop/core/src/main/java/org/teavm/interop/DirectMalloc.java +++ b/interop/core/src/main/java/org/teavm/interop/DirectMalloc.java @@ -26,7 +26,10 @@ package org.teavm.interop; * * @author lax1dude */ -public class DirectMalloc { +public final class DirectMalloc { + + private DirectMalloc() { + } @UnsupportedOn({Platforms.JAVASCRIPT, Platforms.WEBASSEMBLY, Platforms.C}) public static native Address malloc(int sizeBytes); diff --git a/tools/gradle/src/main/java/org/teavm/gradle/tasks/GenerateWasmGCTask.java b/tools/gradle/src/main/java/org/teavm/gradle/tasks/GenerateWasmGCTask.java index 7e244fdf2..0ad674a00 100644 --- a/tools/gradle/src/main/java/org/teavm/gradle/tasks/GenerateWasmGCTask.java +++ b/tools/gradle/src/main/java/org/teavm/gradle/tasks/GenerateWasmGCTask.java @@ -36,6 +36,9 @@ public abstract class GenerateWasmGCTask extends TeaVMTask { getDebugInfoLocation().convention(WasmDebugInfoLocation.EXTERNAL); getSourceMap().convention(false); getSourceFilePolicy().convention(SourceFilePolicy.LINK_LOCAL_FILES); + getDirectMallocSupport().convention(false); + getMinHeapSize().convention(1); + getMaxHeapSize().convention(16); } @Input @@ -98,7 +101,7 @@ public abstract class GenerateWasmGCTask extends TeaVMTask { TaskUtils.applySourceFiles(getSourceFiles(), builder); TaskUtils.applySourceFilePolicy(getSourceFilePolicy(), builder); builder.setDirectMallocSupport(getDirectMallocSupport().getOrElse(false)); - builder.setMinHeapSize(getMinHeapSize().getOrElse(0) * MB); - builder.setMaxHeapSize(getMaxHeapSize().getOrElse(0) * MB); + builder.setMinHeapSize(getMinHeapSize().get() * MB); + builder.setMaxHeapSize(getMaxHeapSize().get() * MB); } }