Class STBUtil
java.lang.Object
club.doki7.stb.STBUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FunctionDescriptorfinal MethodHandlefinal MemorySegment -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfreeMemory(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 withfreefrom the (theoretically) same libc implementation. To use this method, you need to use an STB build that supportsvk4jStbFreeMemoryfunction. Seestb_buildfor more details.If this method is not accessible anyway,
LibcArena.freeNonAllocatedis an alternative with some risk.
-