SoFunction
Updated on 2025-03-10

A brief analysis of Permanent Permanent Persistent Memory Objects (Basic Knowledge of HarmonyOS Hongmeng Development)

HarmonyOS is a distributed operating system that is "for the future" and is aimed at all scenarios (mobile office, sports and health, social transportation, media and entertainment, etc.). Based on the traditional single-device system capabilities, HarmonyOS proposes a distributed concept based on the same system capabilities and adapts to multiple terminal forms, which can support multiple terminal devices.

Permanent Persistent Memory Objects

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

Reference code

Take "Integer cache" in the "" file as an example:

 private static class IntegerCache {
  static final int low = -128;
  static final int high;
  static final Integer cache[];
 
  static {
   ...;
   for(int k = 0; k < ; k++)
    cache[k] = new @Permanent Integer(j++);
   ...;
  }
  ...;
 }

Summarize

This is the article about a brief analysis of the basic Permanent Permanent Permanent Memory Objects (Basic Knowledge of HarmonyOS Hongmeng Development) in Hongmeng. For more related contents of Hongmeng Permanent Permanent Permanent Memory Objects, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!