com.vmlens.trace.agent.bootstrap.callback.HashMapForDirectMemoryAccess Maven / Gradle / Ivy
package com.vmlens.trace.agent.bootstrap.callback;
import gnu.trove.map.hash.TLongObjectHashMap;
public class HashMapForDirectMemoryAccess {
private final TLongObjectHashMap memoryAddress2Element = new
TLongObjectHashMap();
public static interface ElementFactory
{
ELEMENT create();
}
private final ElementFactory factory;
public HashMapForDirectMemoryAccess(ElementFactory factory) {
super();
this.factory = factory;
}
public synchronized ELEMENT getOrCreate(long address)
{
ELEMENT result = memoryAddress2Element.get(address);
if( result == null )
{
result = factory.create();
memoryAddress2Element.put(address, result);
}
return result;
}
// clear()
// {
//
// }
//
//
// allocate()
// {
//
// }
//
//
// reallocate()
// {
//
// }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy