Class STBUtil

java.lang.Object
club.doki7.stb.STBUtil

public final class STBUtil extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • hasFreeMemory

      public boolean hasFreeMemory()
    • freeMemory

      public void freeMemory(MemorySegment segment)

      Free memory allocated by STB functions.

      Some STB functions, stb_vorbis_decode* series for example, allocate memory internally implicitly with linked libc malloc. This method allows you to free that memory with free from the (theoretically) same libc implementation. To use this method, you need to use an STB build that supports vk4jStbFreeMemory function. See stb_build for more details.

      If this method is not accessible anyway, LibcArena.freeNonAllocated is an alternative with some risk.