Skip to content

Optimize pom.xml & Some fixes#25

Merged
jimouris merged 4 commits into
open-quantum-safe:masterfrom
xybei:master
Aug 20, 2024
Merged

Optimize pom.xml & Some fixes#25
jimouris merged 4 commits into
open-quantum-safe:masterfrom
xybei:master

Conversation

@xybei
Copy link
Copy Markdown
Contributor

@xybei xybei commented May 31, 2024

  1. Remove unnecessary dependencies
  2. Fix warning: Raw use of parameterized class 'Pair'
  3. Optimize the way of bundling native lib into jar
    3.1. Output native library to ${project.build.outputDirectory}, avoid using "${basedir}/src/main/resources/" and file copying.
    3.2. Use <linkerFinalName> and <linkerFinalNameExt> to specify the output library name, otherwise invalid link instructions will be added:
    '-o/mnt/d/OpenSource/liboqs-java/target/classes/liboqs-java.jar'
  4. Fix memory leak.
    For the ReleaseByteArrayElements() function, if the mode parameter is JNI_COMMIT, it will cause memory leak.
    JNI_COMMIT: copy back the content but do not free the elems buffer.
    0: copy back the content and free the elems buffer.
    But there is no macro definition of 0 in jni.h.

@xybei
Copy link
Copy Markdown
Contributor Author

xybei commented Jun 2, 2024

Output when <linkerFinalName> and <linkerFinalNameExt> are not configured:
2024-06-02 16 05 44

Output after configuration:
2024-06-02 16 05 45

@xybei xybei changed the title Remove unnecessary dependencies & Fix warning Optimize pom.xml & Fix warning Jun 2, 2024
xybei added 3 commits June 2, 2024 16:26
Signed-off-by: xybei <xybei@outlook.com>
Signed-off-by: xybei <xybei@outlook.com>
1. Output native library to ${project.build.outputDirectory}, avoid using "${basedir}/src/main/resources/" and file copying.
2. Use <linkerFinalName> and <linkerFinalNameExt> to specify the output library name, otherwise invalid link instructions will be added:
   '-o/mnt/d/OpenSource/liboqs-java/target/classes/liboqs-java.jar'

Signed-off-by: xybei <xybei@outlook.com>
Signed-off-by: xybei <xybei@outlook.com>
@xybei xybei changed the title Optimize pom.xml & Fix warning Optimize pom.xml & Some fixes Jun 7, 2024
Copy link
Copy Markdown
Member

@jimouris jimouris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the super delayed response, I somehow had missed this. I see you have removed:

  1. maven-compiler-plugin
  2. maven-jar-plugin
  3. maven-antrun-plugin
  4. maven-resources-plugin

Are those not needed?

Also JNI_COMMIT has been changed to 0, does this solve the memory leak problem?

Comment thread src/main/c/KeyEncapsulation.c
Copy link
Copy Markdown
Member

@jimouris jimouris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for contributing!

@jimouris jimouris merged commit 2b15c8d into open-quantum-safe:master Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants