com.jtransc.ds.IntPool Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtransc-rt-core Show documentation
Show all versions of jtransc-rt-core Show documentation
JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.
package com.jtransc.ds;
public class IntPool {
private int lastId = 0;
private IntStack available = new IntStack();
public int alloc() {
if (available.getLength() == 0) available.push(lastId++);
return available.pop();
}
public void free(int value) {
available.push(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy