Class STBUtil
java.lang.Object
club.doki7.stb.STBUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FunctionDescriptor
final MethodHandle
final MemorySegment
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
freeMemory
(MemorySegment segment) Free memory allocated by STB functions.boolean
-
Field Details
-
PFN$freeMemory
-
MH$freeMemory
-
DESCRIPTOR$freeMemory
-
-
Constructor Details
-
STBUtil
-
-
Method Details
-
hasFreeMemory
public boolean hasFreeMemory() -
freeMemory
Free memory allocated by STB functions.
Some STB functions,
stb_vorbis_decode*
series for example, allocate memory internally implicitly with linked libcmalloc
. This method allows you to free that memory withfree
from the (theoretically) same libc implementation. To use this method, you need to use an STB build that supportsvk4jStbFreeMemory
function. Seestb_build
for more details.If this method is not accessible anyway,
LibcArena.freeNonAllocated
is an alternative with some risk.
-