Jump to content
Excelsior Forums

metaphysicist

Members
  • Content count

    0
  • Joined

  • Last visited

    Never

Community Reputation

0 Neutral

About metaphysicist

  • Rank
    Newbie
  • Birthday 01/01/01
  1. Inefficiency of Pointer.CreateArray

    So I would need to pack my bytes into an int[]? My bytes are big-endian - how does xFunction handfle byte ordering?
  2. Inefficiency of Pointer.CreateArray

    Hi, I have to repeatedly send large chunks (32Kb) of audio data in/out of Java using xFunction. The data chunks are passed in/out using char[] pointer in an xFunction structure. When I am sending data out I use int srb_buflen = buf.length Pointer srb_bufpointer = (Pointer)Argument.create("char*", buf); When I am receiving data I provide an empty buffer to the native function using the exact same procedure: int srb_buflen = buf.length Pointer srb_bufpointer = (Pointer)Argument.create("char*", buf); When the function returns I need to get access to the newly filled data, so I use: char[] outBuf = (char[]) srb_bufpointer.createArray(srb_buflen); BUT when I profile my app I find this exremely inefficient in terms of speed and memory - it's very slow! Because the buffer is 32Kb (32*1024 elements) does this mean that CreateArray has to fill from the values of 32*1024 Character objects? How can I avoid his inefficiency? - a typical transfer for me could be 10MB of 32Kb blocks.
  3. Representing void* argument in xFunction

    Hope I am not missing something here: C: typedef void *LPSRB; DWORD SendASPI32Command ? ?(LPSRB); Java: new xFunction("wnaspi32", "int SendASPI32Command()" What do I fill in for the void* argument?
×