This commit is contained in:
lax1dude 2024-11-02 17:34:37 -07:00
parent c630fae269
commit df6fc752b6
2 changed files with 9 additions and 3 deletions

View File

@ -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);

View File

@ -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);
}
}