CN102750364A - Method, compiler and system for distributing memory address space for image files - Google Patents

Method, compiler and system for distributing memory address space for image files Download PDF

Info

Publication number
CN102750364A
CN102750364A CN2012101943456A CN201210194345A CN102750364A CN 102750364 A CN102750364 A CN 102750364A CN 2012101943456 A CN2012101943456 A CN 2012101943456A CN 201210194345 A CN201210194345 A CN 201210194345A CN 102750364 A CN102750364 A CN 102750364A
Authority
CN
China
Prior art keywords
source file
memory address
current pending
file
free memory
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.)
Granted
Application number
CN2012101943456A
Other languages
Chinese (zh)
Other versions
CN102750364B (en
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.)
XFusion Digital Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210194345.6A priority Critical patent/CN102750364B/en
Publication of CN102750364A publication Critical patent/CN102750364A/en
Application granted granted Critical
Publication of CN102750364B publication Critical patent/CN102750364B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

An embodiment of the invention discloses a method, a compiler and a system for distributing memory address space for image files, and relates to the technical field of computers, so that memory address space can be fully used. The method includes calculating an available memory address range of a current source file to be processed according to memory address space needed by an image file of a prior source file and an available memory address range of prior source file; generating a linker script of the current source file to be processed according to the available memory address range of the current source file to be processed, so that an initial memory address storing the image file recorded in the generated linker script is an initial address of the available memory address range of the current source file to be processed; and enabling the generated linker script to perform compiling link to a source file to be processed and generating the image file of the source file to be processed. The method, the compiler and the system are mainly used for distributing memory address space for multi-image files.

Description

Method, compiler and system for many image files storage allocation address space
Technical field
The present invention relates to field of computer technology, relate in particular to method, compiler and system into many image files storage allocation address space.
Background technology
When writing source code, usually adopt higher level lanquage to write, like C language, C++ etc., still, computing machine can move has only machine language, therefore, need carry out compiling link to source code, and generation can be by the machine language of computer run.Source code is referred to as Image (image file) through the file destination that the compiler compiling link produces; Image is made up of joint district (section); The joint district is a kind of attribute of compiler link, is used for globak symbol (variable, function) is divided into groups, and realizes the appointment of symbol memory address.In the compiling link process, use LSP (linker script links script) regulation how to put into Image to the joint district in the source file, and the layout of each several part in memory address space in the control Image.For ease, effectively at the more business software of existing memory chip deploy, the utilization of memory chip address space resources effective seems particularly important.
In the prior art; When being a plurality of business software storage allocation address space; The memory address space that uses for fear of different I mage overlaps; All be to be each Image storage allocation address space in advance, again each source file carried out compiling link and make the Image of generation use the memory address space that is assigned with in advance.
The method of above-mentioned storage allocation address space resource; The memory address space of dividing for each Image in advance provides through user experience; Can not guarantee to distribute to the memory address space of each Image and the size of this Image adapts, occur distributing to the not enough or more situation of memory address space of certain Image easily.If it is not enough to distribute to the memory address space of certain Image, then must be each Image storage allocation address space again, otherwise the Image corresponding service that memory address space is not enough can't realize, expends huge workload; If it is more to distribute to the memory address space of certain Image; Though be not each Image storage allocation address space again; Also can realize the Image corresponding service that memory address space is more, but can cause the memory address fragment to exist, cause the waste of memory address space.
Summary of the invention
Embodiments of the invention provide a kind of method, compiler and system of many image files storage allocation address space that be, can make full use of memory address space.
For achieving the above object, embodiments of the invention adopt following technical scheme:
On the one hand, a kind of is the method for many image files storage allocation address space, comprising:
Calculate the free memory address realm of current pending source file according to the free memory address realm of required memory address space of the image file of previous source file and previous source file;
Generate the link script of said current pending source file according to the free memory address realm of current said pending source file, making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file;
Use the link script that generates that said current pending source file is carried out compiling link, generate the image file of said current pending source file.
Further optional, before the free memory address realm of said memory address space required according to the image file of previous source file and previous source file calculated the free memory address realm of current pending source file, said method also comprised:
The size in each joint district that comprises according to the image file of previous source file is calculated the required memory address space of image file of previous source file.
Further optional, the said required memory address space of image file of from the free memory address realm of previous source file, removing previous source file comprises:
Confirm the start address of the free memory address realm of previous source file;
Begin from said start address, remove the required memory address space of image file of previous source file.
Further optional, the link script that said free memory address realm according to current pending source file generates said current pending source file comprises:
The shared attribute in each joint district in the said current pending source file is added in the said current pending source file;
According to the shared attribute in each joint district in the said current pending source file and the link script that said current free memory address realm generates said current pending source file; Perhaps,
Revise the initial memory address of depositing image file that writes down in the preset link script according to current free memory address realm, obtain the link script of said current pending source file.
Further optional, the link script that said free memory address realm according to current pending source file generates said current pending source file comprises:
Confirm the initial memory address of depositing said each joint district that writes down in the link script of said current pending source file according to the size in each joint district in the said current pending source file.
On the other hand, a kind of compiler comprises:
First computing unit; Be used for calculating the free memory address realm of current pending source file, the free memory address realm of the said current pending source file that obtains is sent to generation unit according to the free memory address realm of required memory address space of the image file of previous source file and previous source file;
Generation unit; Be used to receive the free memory address realm of the said current pending source file that said first computing unit sends; Generate the link script of said current pending source file according to the free memory address realm of said current pending source file; Making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file, and the link script of the said current pending source file that generates is sent to the compiling link unit;
The compiling link unit is used to receive the link script of the said current pending source file that said generation unit sends, and uses the link script that generates that said current pending source file is carried out compiling link, generates the image file of said current pending source file.
Further optional, also comprise:
Second computing unit; The size that is used for each joint district that the image file according to previous source file comprises is calculated the required memory address space of image file of previous source file, and the memory address space that the image file of the previous source file that calculates is required is sent to said first computing unit;
Said first computing unit also is used to receive the required memory address space of image file of the previous source file that said second computing unit sends.
Further optional, said first computing unit comprises:
First confirms subelement, be used for the start address of the free memory address realm of definite previous source file, and the said start address that will confirm is sent to the removal subelement;
Remove subelement, be used to receive the said start address that said definite subelement sends, begin, remove the required memory address space of image file of previous source file from said start address.
Further optional, said generation unit comprises:
Add subelement; Be used for the shared attribute in each joint district of said current pending source file is added in the said current pending source file; Each shared attribute that saves the district in the said current pending source file is sent to first generates subelement, or the shared attribute in each joint district in the said current pending source file is sent to the second generation subelement;
First generates subelement; Be used for receiving the shared attribute in each joint district of said current pending source file that said interpolation subelement sends, according to the shared attribute in each joint district in the said current pending source file and the link script that said current free memory address realm generates said current pending source file; Perhaps,
Second generates subelement; Be used for receiving the shared attribute in each joint district of said current pending source file that said interpolation subelement sends; Revise the initial memory address of depositing image file that writes down in the preset link script according to current free memory address realm, obtain the link script of said current pending source file.
Further optional, said generation unit comprises:
Second confirms subelement, is used for confirming the initial memory address of depositing said each joint district that writes down in the link script of said current pending source file according to the size in each joint district of said current pending source file.
Again on the one hand, a kind of computer system, said computer system comprises at least one processor and internal memory, and operation has operating system on the said processor, and operation has compiler on the said operating system, and said compiler is used for:
From the free memory address realm of previous source file, remove the required memory address space of image file of previous source file, obtain the free memory address realm of current pending source file;
Generate the link script of said current pending source file according to the free memory address realm of current pending source file, making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file;
Use the link script that generates that said current pending source file is carried out compiling link, generate the image file of said current pending source file;
Said processor receives the image file of the said current pending source file of said compiler transmission, and handles.
The embodiment of the invention provide for method, compiler and the system of many image files storage allocation address space; Before each source file is compiled; At first, calculate the free memory address realm of current pending source file according to the free memory address realm of required memory address space of the image file of previous source file and previous source file; Generate the link script of said current pending source file according to the free memory address realm of current pending source file, making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file; Use the link script that generates that said pending source file is carried out compiling link; Generate the image file of pending source file; Because being used for carrying out the initial memory address of depositing image file that the link script of compiling link writes down is the start address of the free memory address realm of current pending source file, so can make full use of memory address space.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention; The accompanying drawing of required use is done to introduce simply in will describing embodiment below; Obviously, the accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills; Under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
The process flow diagram of a kind of method for many image files storage allocation address space that Fig. 1 provides for the embodiment of the invention;
The another kind that Fig. 2 provides for the embodiment of the invention is the process flow diagram of the method for many image files storage allocation address space;
A kind of realization flow synoptic diagram when Fig. 3 is 5 source files embodiment illustrated in fig. 2;
Another kind of realization flow synoptic diagram when Fig. 4 is 5 source files embodiment illustrated in fig. 2;
The structural drawing of a kind of compiler that Fig. 5 provides for the embodiment of the invention;
The structural drawing of another compiler that Fig. 6 provides for the embodiment of the invention;
The structural drawing of a kind of computer system that Fig. 7 provides for the embodiment of the invention.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
It is a kind of for the method for many image files storage allocation address space, as shown in Figure 1 that the embodiment of the invention provides, and comprising:
101, calculate the free memory address realm of current pending source file according to the free memory address realm of required memory address space of the image file of previous source file and previous source file.
102, generate the link script of current pending source file according to the free memory address realm of current pending source file, making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of current pending source file.
Before each source file being carried out compiling link generation image file; At first; Generation is used to carry out source file is carried out the link script of compiling link; Making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of current pending source file; So that when current pending source file was carried out compiling link, the employed memory headroom of image file of the image file storage allocation address space of generation and previous generation was continuous.
103, use the link script that generates to treat the process source file and carry out compiling link, generate the image file of pending source file.
Present embodiment provide for the method for many image files storage allocation address space; Before each source file is compiled; At first, calculate the free memory address realm of current pending source file according to the free memory address realm of required memory address space of the image file of previous source file and previous source file; Generate the link script of said current pending source file according to the free memory address realm of current pending source file, making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file; Use the link script that generates that said pending source file is carried out compiling link; Generate the image file of pending source file; Because being used for carrying out the initial memory address of depositing image file that the link script of compiling link writes down is the start address of the free memory address realm of said current pending source file, so can make full use of memory address space.
When constantly releasing new business software, if processor still adopts the monokaryon framework or the multicore architecture that only comprise CPU to realize that these new business will be difficult to realize in order to meet consumers' demand; Therefore, current, processor adopting heterogeneous polynuclear framework is realized; The heterogeneous polynuclear framework is about to dissimilar kernels and is integrated in on the chip piece; In this framework, floating-point operation that CPU core was bad at and signal Processing work are carried out by other programmable core that is integrated in on the chip piece.Along with increasing of business software and increasing of kernel, just need to utilize more fully, efficiently the various resources of chip.Wherein, the address space resource is exactly a kind of very important resource.The embodiment of the invention provides the another kind of method of many image files storage allocation address space that is, this method adopts the mode of the compact discharging of address space, makes full use of address space.Specific as follows:
As shown in Figure 2, comprising:
The size in each joint district that 201, comprises according to the image file of previous source file is calculated the required memory address space of image file of previous source file.
Step 201 can be with comprising:
201a, confirm the start address of the free memory address realm of previous source file.
201b, begin, remove the required memory address space of image file of previous source file from said start address.
Concrete; When implementing this programme; A configuration file (configure File) can be set in advance, write down the shared attribute that current free memory address resource as shown in table 1 and each related joint of image file as shown in table 2 are distinguished in this configuration file.
Figure BDA00001761976900071
Table 1
About the free memory address resource of record in the table 1, the remaining free memory address space of chip internal memory maybe be also discontinuous, therefore need write down all available address space scopes one by one.Wherein on behalf of a continuation address name in a name space, name indication content claim code name; Address indication content is represented the start address of corresponding continuation address space address scope; Len indication content is represented the length scale of corresponding continuation address space address scope.The specified value of address and len needs to be complementary with actual hardware chip.
Figure BDA00001761976900081
Table 2
Possibly there is the definition in a plurality of joints district in shared attribute about each joint district of record in the table 2 in the link script, therefore need the shared attribute in each joint district of mark and the region of memory that this joint district need deposit one by one.All equal consecutive hours of memory address space in chip, this attribute can omit.Wherein the representative of name indication content saves the title in district; Group indication content is represented the shared privately owned attribute in corresponding joint district, and for example all here then represents the joint district that all nuclears are shared, and dsps represent all shared joint districts of DSP nuclear; The joint district that core7 representative nuclear 7 is privately owned; The continuation address space title that the corresponding joint of the specified content representative of memory district need be assigned to.
During the required memory address space of the image file of calculation sources file, the size in each joint district that comprises according to the image file of this source file is calculated the required memory address space of image file of this source file.Concrete, confirm the initial memory address of depositing each joint district that writes down in the link script of current pending source file according to the size in each joint district in the current pending source file.
For the ease of calculating the size in each joint district in the image file; When generating this image file, at first, through analyzing the content of current configuration file; Know the shared attribute in each joint district in the current source file; Confirm the size in each joint district according to the shared attribute in each joint district, and from big to small the joint district that is used for current source file is compiled this definition of connection chain pin is arranged again, simultaneously according to each joint district; In the link script of resetting, insert some special marks, the size in all kinds of joints district in the living image file so that statistic chain is practiced midwifery.Special mark can be provided with arbitrarily according to actual needs, as sharing different joint districts with different arabic numeral signs.
202, calculate the free memory address realm of current pending source file according to the free memory address realm of required memory address space of the image file of previous source file and previous source file.
Concrete, from the free memory address realm of previous source file, remove the required memory address space of image file of previous source file, obtain the free memory address realm of current pending source file.
According to the free memory address space of the current pending source file of Data Update of previous image file, concrete, at first, confirm the start address of the free memory address realm of previous source file; Then, begin, remove the required memory address space of image file of previous source file from the start address of confirming.
203, generate the link script of current pending source file according to the free memory address realm of current pending source file, making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of current pending source file.
Before each source file being carried out compiling link generation image file; At first; Generation is used to carry out source file is carried out the link script of compiling link; Making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of current pending source file; So that when current pending source file was carried out compiling link, the employed memory headroom of image file of the image file storage allocation address space of generation and previous generation was continuous.
As a kind of embodiment of present embodiment, step 202 can realize through the following steps mode:
203a, the shared attribute that each joint in the current pending source file is distinguished add in the current pending source file;
203b, according to the shared attribute in each joint district in the current pending source file and the link script that current free memory address realm generates current pending source file;
In order to simplify the compiling link flow process; Also can the shared attribute in each joint district in the configuration file be added on the code of source file; Thereby in the process of source file being carried out compiling link, generate the link script that is used for this source file is carried out compiling link automatically, reach the seamless combination of compiling link.
Concrete; Can realize in the following manner the shared attribute in each joint district in the configuration file is added on the code of source file; Expansion C language keyword is described variable and the deposit position of each function and the shared attribute in individual joint district, and the description of extending marking can be following form:
Figure BDA00001761976900091
The key word here _ _ core_ _ (all) mainly is used for describing the shared attribute of specified content, key word _ _ mem_ _ mainly be used for the describing target memory address space that specified content will dispose.
Through a preprocessing process, with above-mentioned expansion C language with increase _ _ mode of attribute_ _ ((section (" name "))) converts the C language of standard to.In this preprocessing process, the address space range that can use according to the system that writes down among the configuration file configure File simultaneously produces corresponding link script.If in advance the link script is not set, suppose that source file quantity is 5, the flow process of this embodiment can be as shown in Figure 3.
Perhaps, as the another kind of embodiment of present embodiment, step 202 also can realize in the following manner:
Revise the initial memory address of depositing image file that writes down in the preset link script according to current free memory address realm, obtain the link script of current pending source file.
Also can be for compiling link is provided with the link script in advance, the initial memory address of depositing image file that writes down in the connection script that this is provided with in advance is any memory address.Before each source file is carried out compiling link; The initial memory address of depositing image file to writing down in the link script that is provided with is in advance made amendment; When using the connection script that is provided with in advance, suppose that source file quantity is 5, the flow process of this embodiment can be as shown in Figure 4.
204, use the link script that generates to treat the process source file and carry out compiling link, generate the image file of pending source file.
Present embodiment provide for the method for many image files storage allocation address space; Before each source file is compiled; At first; From the free memory address realm of previous source file, remove the required memory address space of image file of previous source file, obtain the free memory address realm of current pending source file; Generate the link script of said current pending source file according to the free memory address realm of current pending source file, making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file; Use the link script that generates that said pending source file is carried out compiling link; Generate the image file of pending source file; Because being used for carrying out the initial memory address of depositing image file that the link script of compiling link writes down is the start address of the free memory address realm of said current pending source file, so can make full use of memory address space.
The embodiment of the invention provides a kind of compiler, and is as shown in Figure 5, comprising: first computing unit 51, generation unit 52, compiling link unit 53.
Wherein, First computing unit 51; Be used for calculating the free memory address realm of current pending source file, the free memory address realm of the said current pending source file that obtains is sent to generation unit according to the free memory address realm of required memory address space of the image file of previous source file and previous source file.
Generation unit 52; Be used to receive the free memory address realm of the said current pending source file that said first computing unit sends; Generate the link script of said current pending source file according to the free memory address realm of current pending source file; Making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file, and the link script of the said current pending source file that generates is sent to the compiling link unit;
Compiling link unit 53 is used to receive the link script of the said current pending source file that said generation unit sends, and uses the link script that generates that said pending source file is carried out compiling link, generates the image file of pending source file.
The compiler that present embodiment provides; Before each source file is compiled; At first, first computing unit calculates the free memory address realm of current pending source file according to the free memory address realm of required memory address space of the image file of previous source file and previous source file; Generation unit generates the link script of said current pending source file according to the free memory address realm of current pending source file, and making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file; The compiling link unit uses the link script that generates that said pending source file is carried out compiling link; Generate the image file of pending source file; Because being used for carrying out the initial memory address of depositing image file that the link script of compiling link writes down is the start address of the free memory address realm of said current pending source file, so can make full use of memory address space.
As a kind of improvement of present embodiment, the embodiment of the invention provides another kind of compiler, and is as shown in Figure 6, comprising: second computing unit 61, first computing unit 62, generation unit 63, compiling link unit 64.
Wherein, first computing unit 62 comprises: first confirms subelement 621, removal subelement 622; Generation unit 63 comprises: add subelement 631, first and generate subelement 632, the second generation subelement, 633, second definite subelement 634.
Second computing unit 61; The size that is used for each joint district that the image file according to previous source file comprises is calculated the required memory address space of image file of previous source file, and the memory address space that the image file of the previous source file that calculates is required is sent to said first computing unit;
Said first computing unit 62 is used to receive the required memory address space of image file of the previous source file that said second computing unit sends.
First computing unit 62; Be used for calculating the free memory address realm of current pending source file according to the free memory address realm of required memory address space of the image file of previous source file and previous source file; Obtain the free memory address realm of said current pending source file, the free memory address realm of the said current pending source file that obtains is sent to generation unit;
First confirms subelement 621, be used for the start address of the free memory address realm of definite previous source file, and the said start address that will confirm is sent to the removal subelement;
Remove subelement 622, be used to receive the said start address that said definite subelement sends, begin, remove the required memory address space of image file of previous source file from said start address.
Generation unit 63; Be used to receive the free memory address realm of the said current pending source file that said first computing unit sends; Generate the link script of said current pending source file according to the free memory address realm of said current pending source file; Making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file, and the link script of the said current pending source file that generates is sent to the compiling link unit;
Add subelement 631; Be used for the shared attribute in each joint district of said current pending source file is added in the said current pending source file; Each shared attribute that saves the district in the said current pending source file is sent to first generates subelement, or the shared attribute in each joint district in the said current pending source file is sent to the second generation subelement;
First generates subelement 632; Be used for receiving the shared attribute in each joint district of said current pending source file that said interpolation subelement sends, according to the shared attribute in each joint district in the said current pending source file and the link script that said current free memory address realm generates said current pending source file; Perhaps,
Second generates subelement 633; Be used for receiving the shared attribute in each joint district of said current pending source file that said interpolation subelement sends; Revise the initial memory address of depositing image file that writes down in the preset link script according to current free memory address realm, obtain the link script of said current pending source file.
Second confirms subelement 634, is used for confirming the initial memory address of depositing said each joint district that writes down in the link script of said current pending source file according to the size in each joint district of said current pending source file.
Compiling link unit 64; Be used to receive the link script of the said current pending source file that said generation unit sends; Use the link script that generates that said current pending source file is carried out compiling link, generate the image file of said current pending source file.
The compiler that present embodiment provides; Before each source file is compiled; At first;, first computing unit calculates the free memory address realm of current pending source file according to the free memory address realm of required memory address space of the image file of previous source file and previous source file; Generation unit generates the link script of said current pending source file according to the free memory address realm of current pending source file, and making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file; The compiling link unit uses the link script that generates that said pending source file is carried out compiling link; Generate the image file of pending source file; Because being used for carrying out the initial memory address of depositing image file that the link script of compiling link writes down is the start address of the free memory address realm of said current pending source file, so can make full use of memory address space.
Present embodiment provides is method, compiler and the system of many image files storage allocation address space, adopts the mode of multinuclear programming, has reduced the working service workload of multinuclear shared resource; The memory headroom of dividing for each Image is provided by current actual free memory address space, can guarantee that enough this Image in space use, and not waste, and the Image that compiling is come out can effectively utilize memory headroom; In the compiling link process, calculate the operating position of each Image one by one, directly carry out internal memory and divide the minimizing workload in particular memory; Need not recomputate even before compiling link, increase service code yet, can not cause readjusting of memory headroom division memory headroom; Internal memory is disposed through once linking just can draw the prioritization scheme that address space distributes.
The embodiment of the invention also provides a kind of computer system; As shown in Figure 7, comprise at least one processor 72 and internal memory 73, operation has operating system on the said processor; Compiler, said compiler are arranged is arbitrary compiler in the foregoing description in operation on the said operating system.Said processor receives the image file of the said current pending source file of said compiler transmission, and handles.
Wherein, Said internal memory 73 comprises a plurality of physical memory pages; And the said internal memory that comprises a plurality of physical memory pages is divided into user's attitude memory field and kernel state memory field; The physical memory page of said user's attitude memory field is used to store user's attitude data and instruction, and the physical memory page of said kernel state memory field is used to store kernel state data and instruction; Said processor 72 calls the code of storing in the said internal memory through said bus, to be used for: when a thread needs storage allocation, discern the type of said thread; If said thread is user's attitude thread, then be this user's attitude thread storage allocation from said user's attitude memory field; If said thread is the kernel state thread, then be this kernel state thread storage allocation from said kernel state memory field.
Aforementioned calculation machine system can further include the user interface 74 that is connected with bus 71.
Optional, said processor 72 also is used for when said thread needs storage allocation, if operating system skips leaf unusually, then distributes the behavior modifier for the Memory Allocation behavior of said thread is provided with user memory; Said user memory distribution behavior modifier is used for the current Memory Allocation behavior of mark to be triggered by user's attitude thread.
Above-mentioned arbitrary computer system can also comprise buffer memory, and this buffer memory can be arranged in the processor, as the shared buffer memory of a plurality of processor cores in this processor.Need to prove that the buffer memory in the embodiment of the invention can be a hardware cache usually, but is not limited to the afterbody high-speed cache, and can be any one buffer memory of being shared by a plurality of processor cores.Aforementioned calculation machine system is not limited to the multi-core computer system, and can be any system of being shared same buffer memory by a plurality of processor cores.
The computer system that present embodiment provides; Compiler is before compiling each source file; At first; From the free memory address realm of previous source file, remove the required memory address space of image file of previous source file, obtain the free memory address realm of current pending source file; Generate the link script of said current pending source file according to the free memory address realm of current pending source file, making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file; Use the link script that generates that said pending source file is carried out compiling link; Generate the image file of pending source file; Because being used for carrying out the initial memory address of depositing image file that the link script of compiling link writes down is the start address of the free memory address realm of said current pending source file, so can make full use of memory address space.
In sum, in the computer system that the embodiment of the invention provides, adopt the mode of multinuclear programming, reduced the working service workload of multinuclear shared resource; Compiler is provided by current actual free memory address space for the memory headroom that each Image divides, and can guarantee that enough this Image in space use, and not waste, and each Image that compiling is come out can effectively utilize memory headroom; In the compiling link process, calculate the operating position of each Image one by one, directly carry out internal memory and divide the minimizing workload in particular memory; Need not recomputate even before compiling link, increase service code yet, can not cause readjusting of memory headroom division memory headroom; Internal memory is disposed through once linking just can draw the prioritization scheme that address space distributes.
In the computer system that the embodiment of the invention provides, realize in compilation process that through compiler the compactness of storage space is arranged, avoid the internal memory arrangement need carry out the situation of secondary link; And can calculate automatically and plan free space with storage space, avoid manually adjusting repeatedly allocation space, raising is linked into power; Truly realized scrappy, memory headroom makes full use of, and avoids in the prior art Image that compiling comes out because the division in advance of memory block causes existing fragment, fails effectively to utilize the situation of memory headroom; Avoid the situation of memory headroom arrangement in the prior art, in other words promptly avoided in the prior art, in case increase readjusting that service code can cause that memory headroom divides, the situation that need recomputate memory headroom service code adjustment restriction.
Through the description of above embodiment, the those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential common hardware, can certainly pass through hardware, but the former is better embodiment under a lot of situation.Based on such understanding; The part that technical scheme of the present invention contributes to prior art in essence in other words can be come out with the embodied of software product, and this computer software product is stored in the storage medium that can read, like the floppy disk of computing machine; Hard disk or CD etc.; Comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
The above; Be merely embodiment of the present invention, but protection scope of the present invention is not limited thereto, any technician who is familiar with the present technique field is in the technical scope that the present invention discloses; Can expect easily changing or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion by said protection domain with claim.

Claims (13)

1. one kind is the method for many image files storage allocation address space, it is characterized in that, comprising:
Calculate the free memory address realm of current pending source file according to the free memory address realm of required memory address space of the image file of previous source file and previous source file;
Generate the link script of said current pending source file according to the free memory address realm of said current pending source file, making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file;
Use the link script that generates that said current pending source file is carried out compiling link, generate the image file of said current pending source file.
2. method according to claim 1; It is characterized in that; Before the free memory address realm of said memory address space required according to the image file of previous source file and previous source file calculated the free memory address realm of current pending source file, said method also comprised:
The size in each joint district that comprises according to the image file of previous source file is calculated the required memory address space of image file of previous source file.
3. method according to claim 1 and 2; It is characterized in that the free memory address realm that said free memory address realm according to required memory address space of the image file of previous source file and previous source file calculates current pending source file is:
From the free memory address realm of previous source file, remove the required memory address space of image file of previous source file, obtain the free memory address realm of current pending source file.
4. according to each described method of claim 1-3; It is characterized in that the free memory address realm that said free memory address realm according to required memory address space of the image file of previous source file and previous source file calculates current pending source file comprises:
Confirm the start address of the free memory address realm of previous source file;
Begin from said start address, remove the required memory address space of image file of previous source file.
5. according to each described method of claim 1-4, it is characterized in that the link script that said free memory address realm according to said current pending source file generates said current pending source file comprises:
The shared attribute in each joint district in the said current pending source file is added in the said current pending source file;
According to the shared attribute in each joint district in the said current pending source file and the link script that said current free memory address realm generates said current pending source file; Perhaps,
Revise the initial memory address of depositing image file that writes down in the preset link script according to current free memory address realm, obtain the link script of said current pending source file.
6. according to each described method of claim 1-5, it is characterized in that the link script that said free memory address realm according to said current pending source file generates said current pending source file comprises:
Confirm the initial memory address of depositing said each joint district that writes down in the link script of said current pending source file according to the size in each joint district in the said current pending source file.
7. a compiler is characterized in that, comprising:
First computing unit; Be used for calculating the free memory address realm of current pending source file, the free memory address realm of the said current pending source file that obtains is sent to generation unit according to the free memory address realm of required memory address space of the image file of previous source file and previous source file;
Generation unit; Be used to receive the free memory address realm of the said current pending source file that said first computing unit sends; Generate the link script of said current pending source file according to the free memory address realm of said current pending source file; Making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file, and the link script of the said current pending source file that generates is sent to the compiling link unit;
The compiling link unit is used to receive the link script of the said current pending source file that said generation unit sends, and uses the link script that generates that said current pending source file is carried out compiling link, generates the image file of said current pending source file.
8. compiler according to claim 7 is characterized in that, also comprises:
Second computing unit; The size that is used for each joint district that the image file according to previous source file comprises is calculated the required memory address space of image file of previous source file, and the memory address space that the image file of the previous source file that calculates is required is sent to said first computing unit;
Said first computing unit also is used to receive the required memory address space of image file of the previous source file that said second computing unit sends.
9. according to claim 7 or 8 described devices; It is characterized in that; Said first computing unit according to the free memory address realm that the free memory address realm of required memory address space of the image file of previous source file and previous source file calculates current pending source file is: said first computing unit is removed the required memory address space of image file of previous source file from the free memory address realm of previous source file, obtain the free memory address realm of current pending source file.
10. according to each described device of claim 7-9, it is characterized in that said first computing unit comprises:
First confirms subelement, be used for the start address of the free memory address realm of definite previous source file, and the said start address that will confirm is sent to the removal subelement;
Remove subelement, be used to receive the said start address that said definite subelement sends, begin, remove the required memory address space of image file of previous source file from said start address.
11., it is characterized in that said generation unit comprises according to each described compiler of claim 7-10:
Add subelement; Be used for the shared attribute in each joint district of said current pending source file is added in the said current pending source file; Each shared attribute that saves the district in the said current pending source file is sent to first generates subelement, or the shared attribute in each joint district in the said current pending source file is sent to the second generation subelement;
First generates subelement; Be used for receiving the shared attribute in each joint district of said current pending source file that said interpolation subelement sends, according to the shared attribute in each joint district in the said current pending source file and the link script that said current free memory address realm generates said current pending source file; Perhaps,
Second generates subelement; Be used for receiving the shared attribute in each joint district of said current pending source file that said interpolation subelement sends; Revise the initial memory address of depositing image file that writes down in the preset link script according to current free memory address realm, obtain the link script of said current pending source file.
12., it is characterized in that said generation unit comprises according to each described compiler of claim 7-11:
Second confirms subelement, is used for confirming the initial memory address of depositing said each joint district that writes down in the link script of said current pending source file according to the size in each joint district of said current pending source file.
13. a computer system is characterized in that said computer system comprises at least one processor and internal memory, operation has operating system on the said processor, and operation has compiler on the said operating system, and said compiler is used for:
From the free memory address realm of previous source file, remove the required memory address space of image file of previous source file, obtain the free memory address realm of current pending source file;
Generate the link script of said current pending source file according to the free memory address realm of current pending source file, making the initial memory address of depositing image file that writes down in the link script of generation is the start address of the free memory address realm of said current pending source file;
Use the link script that generates that said current pending source file is carried out compiling link, generate the image file of said current pending source file;
Said processor receives the image file of the said current pending source file of said compiler transmission, and handles.
CN201210194345.6A 2012-06-13 2012-06-13 Method, compiler and system for distributing memory address space for image files Active CN102750364B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210194345.6A CN102750364B (en) 2012-06-13 2012-06-13 Method, compiler and system for distributing memory address space for image files

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210194345.6A CN102750364B (en) 2012-06-13 2012-06-13 Method, compiler and system for distributing memory address space for image files

Publications (2)

Publication Number Publication Date
CN102750364A true CN102750364A (en) 2012-10-24
CN102750364B CN102750364B (en) 2014-08-13

Family

ID=47030549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210194345.6A Active CN102750364B (en) 2012-06-13 2012-06-13 Method, compiler and system for distributing memory address space for image files

Country Status (1)

Country Link
CN (1) CN102750364B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544042A (en) * 2013-10-15 2014-01-29 广东威创视讯科技股份有限公司 Image file generation method and compiler
CN106445589A (en) * 2016-09-08 2017-02-22 百富计算机技术(深圳)有限公司 Application loading method and apparatus for small embedded system
CN106681771A (en) * 2016-12-30 2017-05-17 合网络技术(北京)有限公司 System reinstallation method and device
CN108304189A (en) * 2016-08-29 2018-07-20 迈普通信技术股份有限公司 More mirroring device software compilation methods, device and equipment
CN109683985A (en) * 2018-12-19 2019-04-26 中国电子科技集团公司第五十四研究所 A kind of more image starting methods of DSP based on AIS order
CN111367787A (en) * 2018-12-26 2020-07-03 阿里巴巴集团控股有限公司 Method and device for checking page script object leakage in application
CN113127430A (en) * 2019-12-30 2021-07-16 北京懿医云科技有限公司 Mirror image information processing method and device, computer readable medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7036118B1 (en) * 2001-12-20 2006-04-25 Mindspeed Technologies, Inc. System for executing computer programs on a limited-memory computing machine
CN101661397A (en) * 2008-08-29 2010-03-03 宇龙计算机通信科技(深圳)有限公司 Method for realizing dynamic loading of program and method and equipment for generating mapping file
CN102135904A (en) * 2011-03-11 2011-07-27 华为技术有限公司 Multi-core target system oriented mapping method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7036118B1 (en) * 2001-12-20 2006-04-25 Mindspeed Technologies, Inc. System for executing computer programs on a limited-memory computing machine
CN101661397A (en) * 2008-08-29 2010-03-03 宇龙计算机通信科技(深圳)有限公司 Method for realizing dynamic loading of program and method and equipment for generating mapping file
CN102135904A (en) * 2011-03-11 2011-07-27 华为技术有限公司 Multi-core target system oriented mapping method and device

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544042A (en) * 2013-10-15 2014-01-29 广东威创视讯科技股份有限公司 Image file generation method and compiler
CN108304189A (en) * 2016-08-29 2018-07-20 迈普通信技术股份有限公司 More mirroring device software compilation methods, device and equipment
CN108304189B (en) * 2016-08-29 2021-03-12 迈普通信技术股份有限公司 Multi-mirror image equipment software compiling method, device and equipment
CN106445589A (en) * 2016-09-08 2017-02-22 百富计算机技术(深圳)有限公司 Application loading method and apparatus for small embedded system
CN106681771A (en) * 2016-12-30 2017-05-17 合网络技术(北京)有限公司 System reinstallation method and device
CN106681771B (en) * 2016-12-30 2020-12-29 阿里巴巴(中国)有限公司 System reinstallation method and device
CN109683985A (en) * 2018-12-19 2019-04-26 中国电子科技集团公司第五十四研究所 A kind of more image starting methods of DSP based on AIS order
CN109683985B (en) * 2018-12-19 2021-10-22 中国电子科技集团公司第五十四研究所 DSP multi-image starting method based on AIS command
CN111367787A (en) * 2018-12-26 2020-07-03 阿里巴巴集团控股有限公司 Method and device for checking page script object leakage in application
CN111367787B (en) * 2018-12-26 2023-06-20 阿里巴巴集团控股有限公司 Method and device for checking leakage of page script object in application
CN113127430A (en) * 2019-12-30 2021-07-16 北京懿医云科技有限公司 Mirror image information processing method and device, computer readable medium and electronic equipment
CN113127430B (en) * 2019-12-30 2024-05-03 北京懿医云科技有限公司 Mirror image information processing method, mirror image information processing device, computer readable medium and electronic equipment

Also Published As

Publication number Publication date
CN102750364B (en) 2014-08-13

Similar Documents

Publication Publication Date Title
CN102750364A (en) Method, compiler and system for distributing memory address space for image files
CN101661486B (en) Method and system for fragment sorting for hard disk of host comprising virtual computer
US11340803B2 (en) Method for configuring resources, electronic device and computer program product
CN110032395B (en) Unified register file for improving resource utilization
CN103534687B (en) Extensible centralized dynamic resource distribution in a clustered data grid
Ding et al. More convenient more overhead: the performance evaluation of Hadoop streaming
CN104346294A (en) Data reading/writing method and device and computer system on basis of multi-level Cache
US9454481B2 (en) Affinity group access to global data
CN102142032B (en) Method and system for reading and writing data of distributed file system
US9619509B2 (en) Database auditing for bulk operations
CN104881466A (en) Method and device for processing data fragments and deleting garbage files
CN102971727A (en) Recording dirty information in software distributed shared memory systems
CN103440136A (en) Distributed authoring and versioning method and system
CN105094691A (en) Data manipulation methods and system, and devices
JP3488500B2 (en) Distributed file system
CN107066205B (en) Data storage system
CN104598293A (en) Online snapshot method and equipment
EP2977897A1 (en) Compatibility method and apparatus
CN103617135B (en) The method and device of digital independent in a kind of storage device
JP6705443B2 (en) Data allocation destination determination device, method and program
CN111381905B (en) Program processing method, device and equipment
Murai et al. Preliminary performance evaluation of Coarray-based implementation of fiber Miniapp suite using XcalableMP PGAS language
CN104700255A (en) Multi-process processing method, device and system
US20050086665A1 (en) Autonomous device driver
CN112988148B (en) Multi-block-chain and cross-platform supporting SDK generation method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20211221

Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Patentee after: xFusion Digital Technologies Co., Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right