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

smetana.core.Memory Maven / Gradle / Ivy

There is a newer version: 1.2025.0
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package smetana.core;

import com.plantuml.api.cheerpj.WasmLog;

final public class Memory {

	public static void free(Object arg) {
	}

	public static int identityHashCode(Globals zz, CString data) {
		if (data == null)
			return 0;

		int result = data.getUid();
		zz.all.put(result, data);
		WasmLog.log("hashsize = " + zz.all.size());
		return result;
	}

	public static CString fromIdentityHashCode(Globals zz, int hash) {
		if (hash % 2 != 0)
			throw new IllegalArgumentException();

		Object result = zz.all.get(hash);
		if (result == null)
			throw new UnsupportedOperationException();

		return (CString) result;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy