static class Pointer.DeallocatorReference extends PhantomReference<Pointer>
PhantomReference
that also acts as a linked
list to keep their references alive until they get garbage collected.
Also keeps track of total allocated memory in bytes, to have it
call System.gc()
when that amount reaches Pointer.maxBytes
.Modifier and Type | Field and Description |
---|---|
(package private) long |
bytes |
(package private) Pointer.Deallocator |
deallocator |
(package private) static Pointer.DeallocatorReference |
head |
(package private) Pointer.DeallocatorReference |
next |
(package private) Pointer.DeallocatorReference |
prev |
(package private) static long |
totalBytes |
Constructor and Description |
---|
DeallocatorReference(Pointer p,
Pointer.Deallocator deallocator) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
add() |
void |
clear() |
(package private) void |
remove() |
String |
toString() |
get
enqueue, isEnqueued
static volatile Pointer.DeallocatorReference head
volatile Pointer.DeallocatorReference prev
volatile Pointer.DeallocatorReference next
Pointer.Deallocator deallocator
static volatile long totalBytes
long bytes
DeallocatorReference(Pointer p, Pointer.Deallocator deallocator)
Copyright © 2018. All rights reserved.