CN109976764A - A kind of handle conversion method - Google Patents

A kind of handle conversion method Download PDF

Info

Publication number
CN109976764A
CN109976764A CN201910243866.8A CN201910243866A CN109976764A CN 109976764 A CN109976764 A CN 109976764A CN 201910243866 A CN201910243866 A CN 201910243866A CN 109976764 A CN109976764 A CN 109976764A
Authority
CN
China
Prior art keywords
handle
pointer
conversion method
present
obtains
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910243866.8A
Other languages
Chinese (zh)
Inventor
古小健
王建忠
罗侍田
程招招
陈家明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Chuanglian Time Technology Co Ltd
Original Assignee
Shenzhen Chuanglian Time Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Chuanglian Time Technology Co Ltd filed Critical Shenzhen Chuanglian Time Technology Co Ltd
Priority to CN201910243866.8A priority Critical patent/CN109976764A/en
Publication of CN109976764A publication Critical patent/CN109976764A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • G06F8/433Dependency analysis; Data or control flow analysis
    • G06F8/434Pointers; Aliasing

Abstract

The present invention relates to a kind of handle conversion method, include the steps that pointer to object moves to right one and obtains handle and handle moves to left one and obtains pointer to object.It is long that method of the invention solves the problems, such as in real time operating system file opening time, and can reduce EMS memory occupation, and can reflect whether File Open malfunctions and error message.

Description

A kind of handle conversion method
Technical field
The present invention relates to a kind of inheritance methods of drawing course.
Background technique
It is one-to-one 32 unsigned integer values that handle, which is with pointer to object,.Pointer to object may map to uniquely Handle, pointer to object also may map to unique object.Operating system provides necessarily programming interface to programmer, at these In interface, allows programmer to access, create and destroy object.So handle passes through with pointer to object in these operating systems Mapping implementation corresponds.
In the prior art, there are mainly two types of handle and pointer to object mapping modes: congruence mapping and table map.
Congruence mapping that is, handle itself is a pointers.Mapping is type conversion herein.Such case Have: " process instance handle ", " module handle ", " resource handle " etc..
It is most common mapping mechanism between pointer to object and handle that table, which maps this,.Operating system creates table, and protects Deposit all objects to be considered.When needing to create new object, sky entrance is first found in the table, then the number of expression object According to inserting wherein.When object is deleted, its data member and its entrance in table are released.
But for congruence mapping, type conversion is only done, pointer to object is directly returned to user, and pointer is converted After integer, it may be possible to which negative does not meet C and provides that handle is the standard for having symbol positive number, and negative can not be used as error Mark.For table mapping, File Open requires to look up unappropriated item in table, distributes to this document, closing of a file It needs to cancel the occupancy to table, causes File Open slower, and need to safeguard table committed memory.
Summary of the invention
In view of the above technical problems, the present invention provides a kind of handle conversion method, including pointer to object moves to right one and obtains The step of handle and handle move to left one and obtain pointer to object.
Further, the handle is 32 place values for having symbol.
Further, last position of the pointer to object is zero.
Compared with prior art, the beneficial effects of the present invention are:
Method of the invention solves the problems, such as that file opening time is long in real time operating system, and can reduce memory and account for With, and can reflect whether File Open malfunctions and error message.
Detailed description of the invention
Fig. 1 is the method for the present invention flow chart.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on The embodiment of the present invention, every other reality obtained by those of ordinary skill in the art without making creative efforts Example is applied, shall fall within the protection scope of the present invention.
The present invention provides a kind of handle conversion method, including pointer to object moves to right one and obtains handle and handle moves to left one The step of position obtains pointer to object.
It is the alignment principle of variable storage allocation according to modern compiler, last position of pointer to object is always zero, object When pointer moves to right one and is converted into handle, obtained handle must be positive number;Occur opening failure, then returns to negative illegal sentence Handle, then.And " 0 " of method pointer to object last bit of the invention so that handle first place becomes 0, that is, is realized just by moving to right one Number.
Method of the invention solves the problems, such as that file opening time is long in real time operating system, and can reduce memory and account for With, and can reflect whether File Open malfunctions and error message.
It although an embodiment of the present invention has been shown and described, for the ordinary skill in the art, can be with A variety of variations, modification, replacement can be carried out to these embodiments without departing from the principles and spirit of the present invention by understanding And modification, the scope of the present invention is defined by the appended.

Claims (3)

1. a kind of handle conversion method, it is characterised in that: move to right one including pointer to object and obtain handle and handle moves to left one The step of position obtains pointer to object.
2. handle conversion method according to claim 1, it is characterised in that: the handle is 32 integer values for having symbol.
3. handle conversion method according to claim 1, it is characterised in that: last position of the pointer to object is zero.
CN201910243866.8A 2019-03-28 2019-03-28 A kind of handle conversion method Pending CN109976764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910243866.8A CN109976764A (en) 2019-03-28 2019-03-28 A kind of handle conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910243866.8A CN109976764A (en) 2019-03-28 2019-03-28 A kind of handle conversion method

Publications (1)

Publication Number Publication Date
CN109976764A true CN109976764A (en) 2019-07-05

Family

ID=67081221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910243866.8A Pending CN109976764A (en) 2019-03-28 2019-03-28 A kind of handle conversion method

Country Status (1)

Country Link
CN (1) CN109976764A (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19742804A1 (en) * 1996-09-27 1998-04-02 Kodak Ltd Computer system for interactive object control
US5890176A (en) * 1996-04-24 1999-03-30 International Business Machines Corp. Object-oriented document version tracking method and apparatus
US20030158836A1 (en) * 2002-02-20 2003-08-21 Dinesh Venkatesh Cluster meta file system of file system cells managed by respective data movers of a network file server
US6662342B1 (en) * 1999-12-13 2003-12-09 International Business Machines Corporation Method, system, and program for providing access to objects in a document
WO2007065356A1 (en) * 2005-12-05 2007-06-14 Beijing Sursen Co., Ltd Document processing method
CN101206586A (en) * 2006-12-19 2008-06-25 康佳集团股份有限公司 Method for managing OS handle
US20090019079A1 (en) * 2007-07-11 2009-01-15 Mats Stefan Persson Method, system and computer-readable media for managing software object handles in a dual threaded environment
CN102214088A (en) * 2010-04-07 2011-10-12 腾讯科技(深圳)有限公司 Document unlocking method and device
CN102855437A (en) * 2011-06-27 2013-01-02 奇智软件(北京)有限公司 File unlocking method and device
US20150169226A1 (en) * 2013-12-17 2015-06-18 Xipeng Shen Technologies for persistent memory programming
CN105468342A (en) * 2014-08-20 2016-04-06 西安慧泽知识产权运营管理有限公司 Novel operating system handle management method
CN106951326A (en) * 2017-03-16 2017-07-14 腾讯科技(深圳)有限公司 A kind of file unlocking method and electronic equipment

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5890176A (en) * 1996-04-24 1999-03-30 International Business Machines Corp. Object-oriented document version tracking method and apparatus
DE19742804A1 (en) * 1996-09-27 1998-04-02 Kodak Ltd Computer system for interactive object control
US6662342B1 (en) * 1999-12-13 2003-12-09 International Business Machines Corporation Method, system, and program for providing access to objects in a document
US20030158836A1 (en) * 2002-02-20 2003-08-21 Dinesh Venkatesh Cluster meta file system of file system cells managed by respective data movers of a network file server
WO2007065356A1 (en) * 2005-12-05 2007-06-14 Beijing Sursen Co., Ltd Document processing method
CN101206586A (en) * 2006-12-19 2008-06-25 康佳集团股份有限公司 Method for managing OS handle
US20090019079A1 (en) * 2007-07-11 2009-01-15 Mats Stefan Persson Method, system and computer-readable media for managing software object handles in a dual threaded environment
CN102214088A (en) * 2010-04-07 2011-10-12 腾讯科技(深圳)有限公司 Document unlocking method and device
CN102855437A (en) * 2011-06-27 2013-01-02 奇智软件(北京)有限公司 File unlocking method and device
US20150169226A1 (en) * 2013-12-17 2015-06-18 Xipeng Shen Technologies for persistent memory programming
CN105468342A (en) * 2014-08-20 2016-04-06 西安慧泽知识产权运营管理有限公司 Novel operating system handle management method
CN106951326A (en) * 2017-03-16 2017-07-14 腾讯科技(深圳)有限公司 A kind of file unlocking method and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
林烟桂: "《Java语言程序设计》", 华中理工大学出版社 *

Similar Documents

Publication Publication Date Title
CN103197948B (en) A kind of electric intelligent devices communicating stipulations script resolving method
EP1933535A2 (en) Merging realtime data flows
CN102164050A (en) Log parsing method and log parsing node device
US20080059491A1 (en) System and method for mapping events into a data structure
CN106095792A (en) The method and apparatus generating database manipulation code
CN103902283B (en) Method for achieving real-time asynchronous communication through model transformation in CORBA
CN106844380A (en) A kind of database operation method, information processing method and related device
CN102521380B (en) Method for importing power grid CIM (common information model) data and SVG (scalable vector graphic) data
CN104268428A (en) Visual configuration method for index calculation
CN107924326A (en) The moving method of updated type is covered
CN100561476C (en) A kind of code generating method based on the ASN type object
CN104881285A (en) Code snippet marking and reusing system based on body
EP2328301A1 (en) Method and apparatus for managing the authority in workflow component based on authority component
CN109446202A (en) Identifier allocation method, device, server and storage medium
CN110321374B (en) Standard file IO operating system and method based on distributed network
CN101110700B (en) Explorer in resource management platform
CN103077017B (en) A kind of embedded memory multiplexing method
CN106165369B (en) System and method for supporting data type conversion in heterogeneous computing environment
CN109976764A (en) A kind of handle conversion method
CN107273764B (en) Security verification method of security protocol implemented by Swift language
CN109388388A (en) Information interacting method, device, equipment and storage medium between functional module
CN103646015A (en) Method and system for sending, receiving and transmitting XML message
CN109446146A (en) A kind of state transition sequence generation method of application layer communication protocol
CN113114757B (en) File transmission method, device and equipment
CN115686497A (en) Business development data management method, development engine, electronic device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination