标签:res ret 内存 and nat int creat ted address
ElasticHashinator.java,
m_tokens = Bits.unsafe.allocateMemory(bytes); m_cleaner = Cleaner.create(this, new Deallocator(m_tokens, bytes)); private static class Deallocator implements Runnable { private long address; private int size; public Deallocator(long address, int size) { this.address = address; this.size = size; } @Override public void run() { if (address == 0) { return; } Bits.unsafe.freeMemory(address); address = 0; m_allocatedHashinatorBytes.addAndGet(-size); } }
http://www.docjar.com/docs/api/sun/misc/Unsafe.html
http://www.docjar.com/docs/api/sun/misc/Cleaner.html
标签:res ret 内存 and nat int creat ted address
原文地址:http://www.cnblogs.com/brayden/p/7424245.html