A C / C++ software plugin extension method and system based on runtime memory just-in-time compilation

CN122308839APending Publication Date: 2026-06-30NINGXIA VOCATIONAL TECHN COLLEGE OF IND & COMMERCE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NINGXIA VOCATIONAL TECHN COLLEGE OF IND & COMMERCE
Filing Date
2026-03-27
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing C/C++ programs are difficult to dynamically extend in terms of functionality at runtime. Dynamic link library solutions suffer from performance overhead and hot update issues, while embedded scripting language solutions are inefficient and have difficulty directly accessing native C/C++ data structures.

Method used

The method adopts a runtime memory-based just-in-time compilation approach. It receives the plugin source code and metadata in compressed package form, parses the assembly information, creates the plugin control block, and compiles it in the host process memory to generate machine code, establishes event port control structure and field mapping, and realizes direct interaction between the plugin and the host.

Benefits of technology

It reduces the performance overhead of dynamic link libraries, supports hot plugin updates, solves ABI compatibility issues, improves runtime efficiency, avoids additional bridging overhead and data copying, and achieves efficient plugin extension.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122308839A_ABST
    Figure CN122308839A_ABST
Patent Text Reader

Abstract

This invention provides a method and system for extending C / C++ software plugins based on runtime memory just-in-time compilation, relating to the field of computer software technology. The method includes: receiving a plugin physical entity containing C / C++ source code and metadata description files; parsing the metadata to construct a plugin control block and event port structure; creating an independent compilation context, injecting port identifiers into the source code, performing two-stage compilation to generate machine code and loading it into memory, writing back the entry address, and putting the plugin into a startup state; establishing event port connection records and field mappings based on the connection declaration before activation; and when an event occurs, directly writing the data field address into the subscribed field pointer array based on the field mapping, and calling a callback function to achieve zero-copy access. This invention solves the problems of poor ABI compatibility, high performance overhead, and difficulty in cross-platform compatibility of traditional dynamic link libraries, overcomes the shortcomings of low performance in scripting languages, and is suitable for software dynamic extension scenarios with high runtime efficiency requirements.
Need to check novelty before this filing date? Find Prior Art