-
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.
- Loading branch information
Showing
76 changed files
with
1,300 additions
and
1,304 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.6.0' | ||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' | ||
} | ||
|
||
rootProject.name = 'cairo' |
39 changes: 39 additions & 0 deletions
39
src/main/java/io/github/jwharm/cairobindings/ArenaCloseAction.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* cairo-java-bindings - Java language bindings for cairo | ||
* Copyright (C) 2023 Jan-Willem Harmannij | ||
* | ||
* SPDX-License-Identifier: LGPL-2.1-or-later | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package io.github.jwharm.cairobindings; | ||
|
||
import java.lang.foreign.Arena; | ||
import java.lang.ref.Cleaner; | ||
|
||
/** | ||
* Helper class to separate the cleanup logic from the object being cleaned | ||
* | ||
* @param arena the Arena that will be closed | ||
* @since 1.18.1 | ||
*/ | ||
public record ArenaCloseAction(Arena arena) implements Runnable { | ||
|
||
// Cleaner used to close the arena | ||
public static final Cleaner CLEANER = Cleaner.create(); | ||
|
||
@Override | ||
public void run() { | ||
arena.close(); | ||
} | ||
} |
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
Oops, something went wrong.