Skip to content

Commit

Permalink
Add new create() to create MemorySegment only
Browse files Browse the repository at this point in the history
  • Loading branch information
YaSuenag committed Dec 22, 2024
1 parent f3d720d commit 64c3bf0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/com/yasuenag/ffmasm/amd64/AMD64AsmBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,23 @@ protected AMD64AsmBuilder(CodeSegment seg, FunctionDescriptor desc){

/**
* Create builder instance.
* Note that FunctionDescriptor will set to null - it means Exception will be
* thrown when build() is called.
*
* @param clazz Class to use.
* @param seg code segment to use in this builder.
* @return Builder instance
* @throws UnsupportedPlatformException thrown when AMD64AsmBuilder is
* attempted to instantiate on unsupported platform.
*/
public static <T extends AMD64AsmBuilder> T create(Class<T> clazz, CodeSegment seg) throws UnsupportedPlatformException{
return create(clazz, seg, null);
}

/**
* Create builder instance.
*
* @param clazz Class to use.
* @param seg code segment to use in this builder.
* @param desc function descriptor
* @return Builder instance
Expand Down

0 comments on commit 64c3bf0

Please sign in to comment.