文档管理中心

Permanent

收起
自动换行
深色代码主题
复制
  1. @Retention(CLASS)
  2. @Target(TYPE_USE)
  3. public @interface Permanent
Annotates persistent memory objects.

You can use this class to annotate an object in the new statement as a persistent memory object, so that the object will not be recycled by the RC of the Ark compiler.

Take "Integer cache" from "Integer.java" file as an example:

收起
自动换行
深色代码主题
复制
  1. private static class IntegerCache {
  2. static final int low = -128;
  3. static final int high;
  4. static final Integer cache[];
  5. static {
  6. ...;
  7. for(int k = 0; k < cache.length; k++)
  8. cache[k] = new @Permanent Integer(j++);
  9. ...;
  10. }
  11. ...;
  12. }

Since:

1
搜索
请输入您想要搜索的关键词