Method for managing chained memory based on state machine

A state machine and memory technology, which is applied in the field of computer software programming, can solve problems such as disordered security and reduced memory space usage efficiency, and achieve the effect of solving disordered and security problems, improving usage efficiency, and a good security mechanism

CN112596889APending Publication Date: 2021-04-02BEIJING LUSTER LIGHTTECH
0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2021-04-02

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention provides a method for managing a chained memory based on a state machine. The method comprises the steps of creating state machine variables of four state queues of idleness, pre-processing, running and pre-resetting, and circularly calling adjacent state queues in sequence according to the sequence of idleness, pre-processing, running and pre-resetting; and when an applicant appliesfor calling the memory space of the state machine variable in any state queue, returning the object pointer contained in the first memory object in the first state queue to the applicant, migrating the object pointer to the queue tail position of the second state queue, and deleting the memory object in the first state queue where the object pointer is located. According to the method, by creating the state machine variables in different states, the state machine variables cover all the states of the memory object in operation, so that the state management of the memory is clearer, the security mechanism is better, the problems of disorder and security generated when multiple threads access a large batch of memories in the prior art are solved, and the use efficiency of the memory space is improved.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The present application relates to the technical field of computer software programming, in particular to a method for managing chained memory based on a state machine. Background technique

[0002] With the expansion of the capacity of memory devices in computer operating systems, the improvement of operating efficiency, and the expansion of the range of addressing space for system memory by 64-bit software programs, program developers have more loosely planned memory during the design process, and the frequency of use doubled compared to the past. Complicated planning and operations bring more risks and workload, such as memory access out of bounds, access overlap, synchronization deadlock, etc., which have gradually become the main problems that plague developers. Therefore, in terms of memory operation and management, more attention and creative development points began to gather, and more and more related strategies emerged.

[0003] A linked li...

Examples

Embodiment approach

[0051] As an implementation, the method also includes:

[0052] In the operation of calling the memory space or resetting the length of the linked list or the size of the memory block, all memory objects in the original memory space are deleted and released.

[0053] In this embodiment, the method also includes:

[0054] When the applicant applies for memory space in different states, set the corresponding state queue mutex object to no signal, and reset it to signal after the operation is completed.

specific Embodiment approach

[0055] On the other hand, the embodiment of the present application also provides specific implementation methods about the method, as follows:

[0056] (1) Interface encapsulation, with block number and block size as input parameters and management objects, pointer as return value or reference parameter encapsulation management object initialization interface function, for each state chain, use memory information structure object pointer as return value or The reference parameter encapsulates the acquisition and return interface functions, and encapsulates the management object release process as a release interface function.

[0057] (2) Initialize, call the initialization function to initialize the management object;

[0058] (3) Obtain free memory, call the free queue interface function to apply for the free memory information structure object pointer, and perform operations such as division and assignment of the memory blocks it contains, and set identification informatio...