-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: documentation and github action
- Loading branch information
Showing
10 changed files
with
222 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created | ||
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle | ||
|
||
name: Gradle Package | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml | ||
settings-path: ${{ github.workspace }} # location for the settings.xml file | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew :lib-core:build | ||
|
||
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in | ||
# the publishing section of your build.gradle | ||
- name: Publish to GitHub Packages | ||
run: ./gradlew :lib-core:publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 15 additions & 2 deletions
17
lib-core/src/main/java/gc/garcol/libcore/MemoryAccess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,37 @@ | ||
package gc.garcol.libcore; | ||
|
||
/** | ||
* Utility class for memory access operations using Unsafe. | ||
* | ||
* @author thaivc | ||
* @since 2024 | ||
*/ | ||
public class MemoryAccess | ||
{ | ||
|
||
/** | ||
* Ensures that all previous loads are visible to subsequent loads. | ||
* This method uses Unsafe's loadFence to provide the memory fence. | ||
*/ | ||
public static void loadFence() | ||
{ | ||
UnsafeHelper.UNSAFE.loadFence(); | ||
} | ||
|
||
/** | ||
* Ensures that all previous stores are visible to subsequent stores. | ||
* This method uses Unsafe's storeFence to provide the memory fence. | ||
*/ | ||
public static void storeFence() | ||
{ | ||
UnsafeHelper.UNSAFE.storeFence(); | ||
} | ||
|
||
/** | ||
* Ensures that all previous loads and stores are visible to subsequent loads and stores. | ||
* This method uses Unsafe's fullFence to provide the memory fence. | ||
*/ | ||
public static void fullFence() | ||
{ | ||
UnsafeHelper.UNSAFE.fullFence(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 13 additions & 1 deletion
14
lib-core/src/main/java/gc/garcol/libcore/Preconditions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
package gc.garcol.libcore; | ||
|
||
/** | ||
* Utility class for checking preconditions. | ||
* Provides methods to validate arguments and state conditions. | ||
* Throws appropriate exceptions if conditions are not met. | ||
* | ||
* @author thaivc | ||
* @since 2024 | ||
*/ | ||
public class Preconditions | ||
{ | ||
/** | ||
* Checks if the provided argument condition is true. | ||
* Throws an IllegalArgumentException with the specified message if the condition is false. | ||
* | ||
* @param success the condition to check | ||
* @param message the exception message to use if the check fails | ||
* @throws IllegalArgumentException if the condition is false | ||
*/ | ||
public static void checkArgument(boolean success, String message) | ||
{ | ||
if (!success) | ||
{ | ||
throw new IllegalArgumentException(message); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.