All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jtransc.ds.IntPool Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.6.8
Show newest version
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