Object creation method, terminal device and storage medium
An object creation and object technology, applied in the direction of multi-program installation, creation/generation of source code, program code conversion, etc., can solve problems such as low object creation efficiency and memory optimization, and achieve the effect of reducing the number of visits and improving efficiency.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0027] see figure 1 , a schematic flowchart of an object creation method provided by an embodiment of the present invention, including the following steps:
[0028] S101. Redefine the interface of the object memory allocation function and the interface of specifying the address to call the constructor;
[0029] The object memory allocation function is used to allocate memory space for the created object, and the specified address calls the callback function to generate the object through the constructor on the specified memory. Generally, during the object creation process, that is, when an object is created through the new method, memory space is randomly allocated in the system memory for the heap or stack area object, and then the construction method is called to generate the object. In the embodiment of the present invention, the memory space of the object is pre-applied, and the memory space of a predetermined size can be applied for through the object memory allocation ...
Embodiment 2
[0040] exist figure 1 on the basis of combining figure 2 The specific process of improving the efficiency of creating objects is described in detail as follows:
[0041] S201, redefine the operator new function and the placement new function;
[0042] When creating an object, the object is generally generated directly through the new operator. In the new operator, there are two processes: allocating memory and calling the constructor. The function of allocating memory in the new operator is operator new, and the function of constructing objects in the allocated memory is placement new.
[0043] Since the memory allocation of the object creation process has been completed during the program compilation, the object memory application operation can be reduced by redefining the operatornew function and the placement new function, and then combined with the redefined function to pre-apply for memory.
[0044] S202. Apply for memory space;
[0045] In the redefined operator new...
Embodiment 3
[0054] A method for creating an object is mainly described above, and a terminal device for creating an object will be described in detail below.
[0055] image 3 A schematic diagram showing the structure of a terminal device for object creation, including:
[0056] Definition module 310: used to redefine the interface of the object memory allocation function and the interface of specifying the address to call the constructor;
[0057] The object memory allocation function is used to allocate memory space for the created object, and the specified address calls the callback function to generate the object through the constructor on the specified memory. Generally, during the object creation process, that is, when an object is created through the new method, memory space is randomly allocated in the system memory for the heap or stack area object, and then the construction method is called to generate the object. In the embodiment of the present invention, the memory space of...
PUM

Abstract
Description
Claims
Application Information

- R&D
- Intellectual Property
- Life Sciences
- Materials
- Tech Scout
- Unparalleled Data Quality
- Higher Quality Content
- 60% Fewer Hallucinations
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2025 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com