MCPcopy Index your code
hub / github.com/java-native-access/jna / newInstance

Method newInstance

src/com/sun/jna/Structure.java:1918–1930  ·  view source on GitHub ↗

Called from native code only; same as #newInstance(Class,Pointer), except that it additionally calls #conditionalAutoRead().

(Class<T> type, long init)

Source from the content-addressed store, hash-verified

1916 * {@link #conditionalAutoRead()}.
1917 */
1918 private static <T extends Structure> T newInstance(Class<T> type, long init) {
1919 try {
1920 T s = newInstance(type, init == 0 ? PLACEHOLDER_MEMORY : new Pointer(init));
1921 if (init != 0) {
1922 s.conditionalAutoRead();
1923 }
1924 return s;
1925 }
1926 catch(Throwable e) {
1927 LOG.log(Level.WARNING, "JNA: Error creating structure", e);
1928 return null;
1929 }
1930 }
1931
1932 /** Create a new Structure instance of the given type, initialized with
1933 * the given memory.

Callers 15

testInstantiationMethod · 0.95
testCryptSignMessageMethod · 0.95
testCreateEmptyMethod · 0.95
enumDependentServicesMethod · 0.95
getRgAttributeMethod · 0.95
getRgCTLEntryMethod · 0.95
getRgExtensionMethod · 0.95
getRgpElementMethod · 0.95
getRgpChainMethod · 0.95

Calls 6

getPointerConstructorMethod · 0.95
newInstanceMethod · 0.95
conditionalAutoReadMethod · 0.80
logMethod · 0.45
useMemoryMethod · 0.45
allocateMemoryMethod · 0.45

Tested by 7

testInstantiationMethod · 0.76
testCryptSignMessageMethod · 0.76
testCreateEmptyMethod · 0.76
testStructureSizeMethod · 0.76
testAlignStructMethod · 0.76