JPS6358557A - Control system for dynamic memory area - Google Patents

Control system for dynamic memory area

Info

Publication number
JPS6358557A
JPS6358557A JP20327586A JP20327586A JPS6358557A JP S6358557 A JPS6358557 A JP S6358557A JP 20327586 A JP20327586 A JP 20327586A JP 20327586 A JP20327586 A JP 20327586A JP S6358557 A JPS6358557 A JP S6358557A
Authority
JP
Japan
Prior art keywords
area
management table
storage area
size
unused
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
JP20327586A
Other languages
Japanese (ja)
Inventor
Seiji Uchida
内田 誠二
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP20327586A priority Critical patent/JPS6358557A/en
Publication of JPS6358557A publication Critical patent/JPS6358557A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To perform the security/release processing at a high speed even in case the security/release processing has high frequency against to the memory areas of different sizes, by using a correspondence type area control table and a mixture type are control table together with a free chain. CONSTITUTION:The pointers to the unused areas in a main memory area are sorted by their sizes and stored in an area size correspondence type area control table 1. While an area size mixture type area control table 2 stores said pointers unsorted. A free chain 3 chains the unused areas in the order of addresses excluding those unused areas registered in the table 1 or 2 in the main memory area. A memory area security processing means of a computer system retrieves the input memory areas having different sizes in the priority order of both tables 1 and 2 and the chain 3 to secure these memory areas. A memory area release processing means registers the memory areas indicated by the input pointers in the priority order of both tables 1 and 2 and the chain 3 and releases these memory areas.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は動的記憶領域管理方式に関し、特に電子計算機
システムにおいて記憶9■域の確保処理および解放処理
を動的に行うための動的記憶領域管理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a dynamic storage area management system, and in particular to a dynamic storage system for dynamically securing and releasing storage areas in a computer system. Regarding area management methods.

〔従来の技術〕[Conventional technology]

従来、この種の動的記憶領域管理方式では、記憶領域の
動的な確保処理および解放処理に、第4図に示すような
主記憶装置内の1空間であるセグメント4における未使
用の記9?+Jll域5をセグメント4でのアドレスの
順に継いだフリーチェイン3を利用するのが一般的であ
る。
Conventionally, in this type of dynamic storage area management system, dynamic storage area allocation and release processing is performed using unused records 9 in segment 4, which is one space in the main storage, as shown in FIG. ? It is common to use a free chain 3 in which +Jll area 5 is inherited in the order of addresses in segment 4.

このようなフリーチェイン3を用いる動的記憶領域管理
方式においては、第5図に示すように、記tα領域5が
その先頭に通常2語からなる制御情報を有している。こ
の制御情報の第1語には、記憶領域5がフリーチェイン
3の構成要素となった場合にフリーチェイン3の次の要
素へのポインタが格納され、第2語には記憶領域5の領
域サイズが格納される。
In such a dynamic storage area management system using the free chain 3, as shown in FIG. 5, the tα area 5 has control information usually consisting of two words at the beginning thereof. The first word of this control information stores a pointer to the next element of free chain 3 when storage area 5 becomes a component of free chain 3, and the second word stores the area size of storage area 5. is stored.

記憶領域5の確保処理とは、確保すべき記憶領域5の領
域サイズを示す数値データを人力データとして、この数
値で示される領域サイズを有する記憶領域5を求めて、
この記憶領域5の位置を示すポインタを出力する処理で
ある。この記t’l fIJl域5の確保処理の一例で
は、まずフリーチェイン3を先頭の記憶領域5から順に
検索し、確保すべき・領域サイズ以上の大きさを有する
記憶領域5を発見する0次に、発見した記憶領域5に確
保すべき領域サイズを上まわる部分領域があれば、この
記4Lq領域5を確保すべき領域サイズの記(α領域と
残りの領域サイズの記憶領域とに2分し、確保すべき領
域サイズの記憶領域へのポインタを出力して、残りの領
域サイズの記憶領域はフリーチェイン3に残す。また、
発見した記憶領域5に確保すべき領域サイズを上まわる
大きさの部分領域がなければ、この記憶領域5へのポイ
ンタを出力し、フリーチェイン3からこの記憶領域5を
削除するとともにフリーチェイン3を再構成する処理を
行う。
The process of securing the storage area 5 is to use numerical data indicating the area size of the storage area 5 to be secured as manual data, and to obtain the storage area 5 having the area size indicated by this numerical value.
This is a process of outputting a pointer indicating the location of this storage area 5. In this example of the reservation process for the area 5, the free chain 3 is first searched in order from the first storage area 5, and a storage area 5 having a size equal to or larger than the area size to be secured is found. If there is a partial area larger than the area size that should be secured in the discovered storage area 5, then write 4. Then, it outputs a pointer to the storage area of the area size to be secured, and leaves the storage area of the remaining area size in free chain 3.
If there is no partial area larger than the area size to be secured in the discovered storage area 5, a pointer to this storage area 5 is output, this storage area 5 is deleted from the free chain 3, and the free chain 3 is Perform the reconfiguration process.

記憶領域5の解放処理とは、解放すべき記憶領域5への
ポインタを人力とし、このポインタで指される記憶領域
5を未使用領域として再使用可能にする処理である。こ
の記憶領域5の解放処理の一例では、まずフリーチェイ
ン3をその先頭の記憶領域5から順に検索し、解放すべ
き記憶領域5のアドレスを挟む2つの隣接したフリーチ
ェイン3の構成要素を求め、解放すべき記憶領域5が前
後2つの構成要素の少な(とも1つと連続している場合
にはこれを連結して記憶領域5の細分化を避け、連続し
ていない場合には解放すべき記憶領域5をフリーチェイ
ン3の構成要素きしてフリーチェイン3を再構成する処
理を行う。
The process of releasing the storage area 5 is a process in which a pointer to the storage area 5 to be released is manually set, and the storage area 5 pointed to by this pointer is made reusable as an unused area. In an example of the process of releasing the storage area 5, first, the free chain 3 is searched in order from the first storage area 5, and components of two adjacent free chains 3 sandwiching the address of the storage area 5 to be released are found. If the storage area 5 to be released is a small number of the two components before and after (both are contiguous with one, then connect them to avoid fragmentation of the storage area 5, and if they are not contiguous, the memory to be released is Processing is performed to reconstruct the free chain 3 by using the region 5 as a constituent element of the free chain 3.

なお、利用者にポインタ演算の実行を認めている言語処
理系においては、入力した解放すべき記憶領域5へのポ
インタが実際に確保された記憶領域5の先頭を指してい
るか否かを確認するために確保された状態にある記憶領
域5をチェインに継いだ割付はチェインを有し、解放処
理を行う場合にまずこの割付はチェインを検索すること
によって人力したポインタの正当性を確認しているもの
が多い。この場合、チェインの検索を2度行うために生
じるオーバーヘッドを避けるために、未使用領域と確保
されている記憶領域とをタグによって判別することによ
ってチェインを一本化している例がある。
Note that in language processing systems that allow the user to perform pointer operations, it is checked whether the input pointer to the storage area 5 to be released actually points to the beginning of the allocated storage area 5. The allocation in which the storage area 5, which is secured for this purpose, is connected to the chain has a chain, and when performing release processing, this allocation first checks the validity of the manually created pointer by searching the chain. There are many things. In this case, in order to avoid the overhead caused by searching the chain twice, there is an example in which the chains are unified by determining unused areas and reserved storage areas by tags.

ところで、記1i2eJI域5の確保処理および解放処
理が動的に行われる場合、その発生形態は確保処理およ
び解放処理の対象となる記憶領域5の領域サイズから見
ると、通常、次の2つの場合のいずれかに8亥当する。
By the way, when the reservation processing and release processing of the 1i2eJI area 5 are dynamically performed, the following two cases usually occur when looking at the area size of the storage area 5 that is the target of the reservation processing and release processing. Win 8 yen for any of the following.

11)  比較的大きな記憶領域5が確保され、確保処
理および解放処理があまり発生しない場合。
11) A case where a relatively large storage area 5 is secured and the securing process and release process do not occur much.

(2)  −度に大きな記憶領域5は確保されないが、
多様な大きさの記憶領域5に対する確保処理および解放
処理が多発し、かつ数種類の大きさの記憶領域5に対す
る確保処理および解放処理が多い場合。
(2) -Although a large storage area 5 is not secured at each time,
A case where securing processing and releasing processing for storage areas 5 of various sizes occur frequently, and securing processing and releasing processing for storage areas 5 of several different sizes occur frequently.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述した従来の動的記憶領域管理方式は、記憶領域の検
索にフリーチェーンを使用しているので、記憶領域の確
保処理および解放処理のいずれにおいてもチェインを検
索することが多(、記憶領域の確保処理および解放処理
が遅いという欠点がある。籾に、記憶領域の確保処理お
よび解放処理が頻繁に発生するプログラムにおいては、
チェインの長さが増大するために上記の欠点はさらに顕
著なものとなる。
The conventional dynamic storage management method described above uses free chains to search for storage areas, so chains are often searched for both storage area allocation and release processing. The drawback is that the process of allocating and releasing memory space is slow.
The above disadvantages become even more pronounced as the length of the chain increases.

本発明の目的は、上述の点に遥み、複数種類の大きさの
記憶領域に対する確保処理および解放処理が多発する場
合にも、記憶領域の確保処理および解放処理が高速に行
えるようにした動的記憶領域管理方式を提供することに
ある。
An object of the present invention is to provide an operation system that enables high-speed storage area allocation and release processing even when storage areas of multiple sizes are frequently allocated and released. The objective is to provide a storage area management method for

〔問題点を解決するための手段〕[Means for solving problems]

本発明の動的記憶領域管理方式は、主記憶領域内の未使
用領域へのポインタを未使用領域の領域サイズで分類し
て格納する領域サイズ対応型領域管理表と、前記主記憶
領域内の未使用領域へのポインタを未使用領域の領域サ
イズでは分類せずに格納する領域サイズ混合型領域管理
表と、前記主記憶領域内の前記領域サイズ対応型領域管
理表および前記領域サイズ混合型領域管理表のいずれか
に登録された未使用領域を除く未使用領域をアドレスの
順にチェインで継いだフリーチェインと、入力された領
域サイズを有する記憶領域を前記領域サイズ対応型領域
管理表、前記領域サイズ混合型領域管理表および前記フ
リーチェインの優先順位で検索して記憶領域を確保する
記憶領域解放処理手段と、入力されたポインタで指され
る記19領域を前記領域サイズ対応型領域管理表、前記
領域サイズ混合型領域管理表および前記フリーチェイン
の優先順位で登録して記憶領域を解放する記憶領域解放
処理手段とを有する。
The dynamic storage area management method of the present invention includes an area size-aware area management table that stores pointers to unused areas in the main storage area classified by area size of the unused area; an area size mixed type area management table that stores pointers to unused areas without classifying them according to the area size of the unused area; the area size corresponding type area management table in the main storage area; and the area size mixed type area in the main storage area. A free chain in which unused areas other than unused areas registered in any of the management tables are chained in the order of addresses, and a storage area having the input area size are stored in the area size-based area management table and the area. a storage area release processing means for reserving a storage area by searching based on the size mixed area management table and the priority order of the free chain; and the area size corresponding type area management table, The storage area release processing means registers the area size mixed area management table and the free chain priority and releases the storage area.

〔作用〕[Effect]

本発明の動的記憶領域管理方式では、領域サイズ対応型
領域管理表が主記憶領域内の未使用領域へのポインタを
未使用領域の領域サイズで分類して格納し、領域サイズ
混合型領域管理表が主記憶領域内の未使用領域へのポイ
ンタを未使用領域の領域サイズでは分類せずに格納し、
フリーチェインが主記憶領域内の領域サイズ対応型領域
管理表および領域サイズ混合型領域管理表のいずれかに
登録された未使用領域を除く未使用領域をアドレスの順
にチェインで継ぎ、記憶領域確保処理手段が入力された
領域サイズを存する記憶領域を領域サイズ対応型領域管
理表、領域サイズ混合型領域管理表およびフリーチェイ
ンの優先順位で検索して記ti碩域を確保し、記憶領域
解放処理手段が人力されたポインタで指される記憶領域
を領域サイズ対応型領域管理表、領域サイズ混合型領域
管理表およびフリーチェインの優先順位で登録して記憶
領域を解放する。
In the dynamic storage area management method of the present invention, an area size-aware area management table stores pointers to unused areas in the main storage area classified by area size of the unused area, and area size mixed area management A table stores a pointer to an unused area in the main storage area without classifying it by the area size of the unused area,
The free chain concatenates unused areas in the main storage area, excluding unused areas registered in either the area size-based area management table or the area size mixed area management table, in the order of addresses, and secures the storage area. A means searches for a storage area in which the input area size exists using an area size compatible area management table, an area size mixed area management table, and free chain priority, secures a storage area, and releases a storage area. The storage area pointed to by the manually entered pointer is registered in the area size corresponding type area management table, area size mixed type area management table, and free chain priority, and the storage area is released.

〔実施例〕〔Example〕

次に、本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は、本発明の一実施例を示す構成図である。本実
施例の動的記憶領域管理方式は、主記憶装置のセグメン
ト4内における未使用領域へのポインタを未使用領域の
領域サイズで分類して登録する領域サイズ対応型領域管
理表(以下、筆に対応型領域管理表と称する)1と、セ
グメント4内の未使用領域へのポインタを未使用領域の
領域サイズでは分類せずにどのような領域サイズの未使
用領域へのポインタをも登録する領域サイズ混合型領域
管理表(以下、単に混合型領域管理表と称する)2と、
対応型領域管理表1および混合型領域管理表2のいずれ
かに登録された未使用領域を除くセグメント4内の未使
用領域をアドレスの順にチェインで継いだフリーチェイ
ン3とから、その主要部が構成されている。
FIG. 1 is a configuration diagram showing an embodiment of the present invention. The dynamic storage area management method of this embodiment is based on an area size-based area management table (hereinafter referred to as "write") in which pointers to unused areas in segment 4 of the main storage device are classified and registered according to the area size of the unused area. (referred to as a compatible area management table) 1 and a pointer to an unused area in segment 4 is not classified by the area size of the unused area, but registers a pointer to an unused area of any area size. an area size mixed area management table (hereinafter simply referred to as a mixed area management table) 2;
From free chain 3, which is a chain of unused areas in segment 4 excluding unused areas registered in either corresponding type area management table 1 or mixed type area management table 2, the main part is It is configured.

対応型領域管理表1は、記憶領域5の確保処理および解
放処理が頻繁に発生する複数種類の領域サイズの未使用
領域を複数個ずつ登録するためのテーブルであり、M(
正整数)×N(正整数)の2次元の配列で構成されてい
る。対応型領域管理表1の各列は、確保処理および解放
処理の対象となる記憶領域5の領域サイズに対応してお
り、列を数える順に記憶領域5の領域サイズが大きくな
っている。対応型領域管理表1の先頭行を除く各行には
、同一の領域サイズの未使用領域へのポインタが順番に
格納されており、先頭行には列内での未使用領域へのポ
インタが収められている要素の個数が格納されている。
The compatible area management table 1 is a table for registering a plurality of unused areas of multiple types of area sizes in which the process of securing and releasing the storage area 5 frequently occurs.
It is composed of a two-dimensional array of (positive integer)×N (positive integer). Each column of the corresponding area management table 1 corresponds to the area size of the storage area 5 that is subject to reservation processing and release processing, and the area size of the storage area 5 increases in the order in which the columns are counted. Pointers to unused areas of the same area size are stored in order in each row of Corresponding Area Management Table 1, except for the first row, and the first row stores pointers to unused areas within a column. Stores the number of elements that are displayed.

混合型領域管理表2は、対応型領域管理表1を補助する
ためのテーブルであり、K(正整数)×2の2次元の配
列で構成されている。混合型領域管理表2の第1列目に
は、先頭行を除いて順番に未使用領域へのポインタが収
められ、先頭行には列内で未使用領域へのポインタが収
められている要素の個数が格納されている。混合型領域
管理表2の第2列目の先頭行を除く各行には、第1列目
の対応する行の要素である未使用領域へのポインタで指
された記憶領域5の領域サイズが格納されている。
The mixed type area management table 2 is a table for supporting the corresponding type area management table 1, and is composed of a two-dimensional array of K (positive integer) x 2. The first column of the mixed area management table 2 stores pointers to unused areas in order except for the first row, and the first row contains elements that store pointers to unused areas within the column. The number of items is stored. Each row of the mixed area management table 2 except for the first row of the second column stores the area size of the storage area 5 pointed to by the pointer to the unused area that is the element of the corresponding row of the first column. has been done.

フリーチェイン3は、セグメント4内の未使用領域のう
ちの対応型領域管理表1および混合型領域管理表2に登
録されていない未使用領域をアドレスの順にチェインで
継いだものであり、第2図に示した従来の動的記憶領域
管理方式におけるフリーチェイン3と同じ構造を有する
Free chain 3 is a chain of unused areas in segment 4 that is not registered in corresponding type area management table 1 and mixed type area management table 2 in the order of addresses. It has the same structure as the free chain 3 in the conventional dynamic storage area management system shown in the figure.

第2図を参照すると、本実施例の動的記憶領域管理方式
における記憶領域の確保処理は、領域サイズ入力ステッ
プ21と、対応型領域管理表検索ステップ22と、対応
型領域管理表更新ステップ23と、混合型領域管理表検
索ステップ24と、混合型領域管理表更新ステップ25
と、フリーチェーン検索および対応型領域管理表登録ス
テップ26と、記憶領域ポインタ出力ステップ27とか
らなる。
Referring to FIG. 2, the storage area securing process in the dynamic storage area management method of this embodiment includes an area size input step 21, a corresponding area management table search step 22, and a corresponding area management table update step 23. , mixed type area management table search step 24, and mixed type area management table update step 25
, a free chain search and corresponding area management table registration step 26 , and a storage area pointer output step 27 .

第3図を参照すると、本実施例の動的記憶領域管理方式
における記憶領域の解放処理は、記憶領域ポインタ人力
ステップ31と、対応型領域管理表登録判定ステップ3
2と、対応型領域管理表更新ステップ33と、混合型領
域管理表登録判定ステップ34と、混合型領域管理表更
新ステップ35と、フリーチェーン格納ステップ36と
からなる。
Referring to FIG. 3, the storage area release process in the dynamic storage area management method of this embodiment includes the storage area pointer manual step 31 and the corresponding area management table registration determination step 3.
2, a corresponding area management table update step 33, a mixed area management table registration determination step 34, a mixed area management table update step 35, and a free chain storage step 36.

次に、このように構成された本実施例の動的記憶領域管
理方式の動作について説明する。
Next, the operation of the dynamic storage area management system of this embodiment configured as described above will be explained.

(11記憶領域の確保処理 記憶領域5の確保処理では、まず確保すべき記憶領域5
の領域サイズn(正整数)が入力される(ステップ21
)。
(11 Storage area securing process In the storage area 5 securing process, first the storage area 5 to be secured is
The area size n (positive integer) of is input (step 21
).

次に、入力された領域サイズnの未使用領域が対応型領
域管理表1に登録されいるかどうかを検索する(ステッ
プ22)、詳しくは、対応型領域管理表1に領域サイズ
nに対応する列があり、かつその列内の先頭行が示す未
使用領域へのポインタの登録個数mがOでない場合には
、その列の先頭行に格納されている登録個数mを1つ滅
して対応型領域管理表1を更新しくステップ23)、そ
の列の第m行に格納されていた記憶領域5へのポインタ
を出力して確保処理を終了する(ステップ27)。
Next, it is searched whether the unused area of the input area size n is registered in the compatible area management table 1 (step 22). , and if the registered number m of pointers to the unused area indicated by the first row in that column is not O, then the registered number m stored in the first row of that column is deleted by one and the corresponding area is created. The management table 1 is updated (step 23), a pointer to the storage area 5 stored in the m-th row of that column is output, and the reservation processing is ended (step 27).

対応型領域管理表1に確保すべき領域サイズnに対応す
る列がない場合および対応する列はあるが登録個数がO
である場合には、混合型領域管理表2に確保すべき領域
サイズn以上の大きさの未使用領域が登録されているか
否かを検索する(ステップ24)、詳しくは、混合型領
域管理表2の第1列の先頭行が示す未使用領域へのポイ
ンタの登録個数kが0でない場合には、第2列目の第2
行から順に確保すべき領域サイズnとの大小比較を行い
、確保すべき領域サイズn以上の領域サイズが発見され
るか、もしくは比較の回数かに回に及ぶまでこれが繰り
返される。
When there is no column corresponding to the area size n to be secured in the compatible area management table 1, or when there is a corresponding column but the number of registered items is O
If so, it is searched whether or not an unused area of size n or more to be secured is registered in the mixed type area management table 2 (step 24). If the number k of registered pointers to the unused area indicated by the first row of the first column of 2 is not 0, the second pointer of the second column
Starting from the row, a size comparison is made with the area size n to be secured, and this is repeated until an area size greater than or equal to the area size n to be secured is found, or until the number of comparisons is reached.

t1保すべき領域サイズn以上の領域サイズl(正整数
)を有する未使用領域が登録されていて差(j!−n)
の領域サイズを有する領域部分が確保処理および解放処
理の対象となりうる場合には、領域サイズlの記4a領
域5を領域サイズnの記憶領域と残りの領域サイズ(A
−n)の記t’l Si域とに2分し、確保すべき領域
サイズnの未使用領域へのポインタを出力し、残りの領
域サイズB−n)の記憶領域については後述する記憶領
域の解放処理を行う。
t1 An unused area with an area size l (positive integer) greater than or equal to the area size n to be kept is registered, and the difference (j!-n)
If an area portion having an area size of
- n) description t'l Si area and outputs a pointer to an unused area of area size n to be secured, and the storage area of the remaining area size B - n) is the storage area described later. Performs release processing.

確保すべき領域サイズn以上の領域サイズiを有する未
使用領域が登録されていて差(1−n)の領域サイズを
有する領域部分が確保処理および解放処理の対象となら
ない場合には、この記憶領域5を指すポインタが格納さ
れていた行に第に行の内容を転記し、第1列の先頭行に
格納されている登録個数kを1つ滅じて混合型領域管理
表25を更新しくステップ25)、格納されていた記憶
領域5へのポインタを出力して確保処理を終了する(ス
テップ27)。
If an unused area with an area size i that is greater than or equal to the area size n to be secured is registered, and the area portion with the difference (1-n) in area size is not subject to allocation processing and release processing, this storage The contents of the first row are transferred to the row where the pointer pointing to area 5 was stored, and the registered number k stored in the first row of the first column is deleted by one to update the mixed type area management table 25. Step 25), a pointer to the stored storage area 5 is output, and the securing process is ended (Step 27).

対応型領域管理表1および混合型領域管理表2のいずれ
にも確保すべき領域サイズnを満たす未使用領域が登録
されていない場合には、フリーチェイン3を検索する(
ステップ26)。詳しくは、フリーチェイン3の各構成
要素である記憶領域5について、その先頭から第2語に
格納されている領域サイズに基づいて確保すべき領域サ
イズn以上の大きさであるかどうかをチェックする。こ
の際、対応型領域管理表1にその未使用領域の領域サイ
ズに対応する列があるかどうかも判断し、対応する列が
あった場合には、その列内の先頭行に格納されている登
録個数mがM未満であることを条件として、記憶領域5
をフリーチェイン3から削除し、その列の第(m+1)
行にその記tα領域5へのポインタを格納し、その列の
先頭行の登録個数mに1を加えて対応型領域管理表1を
更新する(ステップ26)。対応型領域管理表1に対応
する列がない場合および対応する列はあるがすでにM個
の未使用領域が登録されている場合には、対応型領域管
理表1へのポインタの登録は行われない。
If an unused area that satisfies the area size n to be secured is not registered in either the compatible area management table 1 or the mixed area management table 2, the free chain 3 is searched (
Step 26). Specifically, it is checked whether the storage area 5, which is each component of the free chain 3, is larger than or equal to the area size n that should be secured based on the area size stored in the second word from the beginning. . At this time, it is also determined whether there is a column corresponding to the area size of the unused area in the corresponding area management table 1, and if there is a corresponding column, it is stored in the first row in that column. On the condition that the registered number m is less than M, the storage area 5
is deleted from free chain 3, and the (m+1)th
A pointer to the tα area 5 is stored in the row, and 1 is added to the registration number m in the first row of the column to update the corresponding area management table 1 (step 26). If there is no corresponding column in the corresponding area management table 1, or if there is a corresponding column but M unused areas have already been registered, the pointer to the corresponding area management table 1 is not registered. do not have.

フリーチェイン3の構成要素である記tfj jJI域
5に対して確保すべき領域サイズn以上であるか否かの
チェックと対応型領域管理表1への登録チェックおよび
登録処理とを行いながら、確保すべき領域サイズn以上
の記憶領域5が検索されると、検索された記+’L ’
pH域5へのポインタが出力されて確保処理が終了され
る(ステップ27)。
While checking whether the area size to be secured for the tfj j JI area 5, which is a component of the free chain 3, is greater than or equal to n, checking the registration in the corresponding area management table 1, and performing the registration process, the area is secured. When a storage area 5 with the desired area size n or more is searched, the searched record + 'L'
A pointer to pH range 5 is output and the securing process is completed (step 27).

(2)記憶領域の解放処理 記憶領域5の解放処理では、まず解放ずべき記ta領域
5へのポインタが入力される(ステップ31)。そして
、入力されたポインタが指す記憶領域5の先頭から第2
語によって記憶領域5の領域サイズnが得られる。
(2) Storage Area Release Process In the storage area 5 release process, first a pointer to the data area 5 to be released is input (step 31). Then, the second point from the beginning of the storage area 5 pointed to by the input pointer is
The area size n of the storage area 5 is obtained by the word.

次に、入力されたポインタが指す記憶領域5が対応型領
域管理表1に登録可能であるかどうかを判断する(ステ
ップ32)、詳しくは、対応型領域管理表1に領域サイ
ズnに対応する列があり、かつその列内の先頭行によっ
て示される登録個数mがM未満である場合には、その列
内の第(m+1)行に解放すべき記憶領域5へのポイン
タを格納し、その列内の先頭行の登録個数mを1つ加算
して対応型領域管理表1を更新し解放処理を終了する(
ステップ33)。
Next, it is determined whether the storage area 5 pointed to by the input pointer can be registered in the corresponding area management table 1 (step 32). If there is a column and the number m of registrations indicated by the first row in that column is less than M, a pointer to the storage area 5 to be released is stored in the (m+1)th row in that column, and the Add one to the registered number m of the first row in the column, update the corresponding area management table 1, and end the release process (
Step 33).

対応型領域管理表1に領域サイズnに対応する列がない
場合および対応する列はあるがすでにM個の未使用領域
が登録されている場合には、次に記(t ’piJI域
5が混合型領域管理表2に登録可能であるかどうかを判
断する(ステップ34)、詳しくは、混合型領域管理表
2の登録個数kを第1列の先頭行から知り、登録個数k
かに未満であれば混合型領域管理表2の第1列の第(k
+1)行に解放すべき記憶領域5へのポインタを格納し
、第2列の第(’に+1)行にこの記tα領域5の領域
サイズnを格納し、第1列の先頭行に格納されている登
録個数kに1を加算して混合型領域管理表2を更新し解
放処理を終了する(ステップ35)。
If there is no column corresponding to the area size n in the corresponding area management table 1, or if there is a corresponding column but M unused areas have already been registered, the following (t'piJI area 5 is Determine whether it can be registered in the mixed-type area management table 2 (step 34). Specifically, the number k of registrations in the mixed-type area management table 2 is determined from the first row of the first column, and the number k of registrations is determined from the first row of the first column.
If it is less than k, the number (k
+1) Store the pointer to the storage area 5 to be released in the row, store the area size n of the tα area 5 in the (+1) row of the second column, and store it in the first row of the first column. The mixed area management table 2 is updated by adding 1 to the registered number k, and the release process is completed (step 35).

対応型領域管理表1および混合型領域管理表2のいずれ
にも登録ができなかった場合には、フリーチェイン3を
検索し、ポインタで指される記tq領域5をフリーチェ
イン3に加えて解放処理を終了する(ステップ36)。
If it cannot be registered in either the corresponding type area management table 1 or the mixed type area management table 2, free chain 3 is searched, and the tq area 5 pointed to by the pointer is added to free chain 3 and released. The process ends (step 36).

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、対応型領域管理表と混合
型領域管理表とフリーチェインとを併せて用いることに
より、−度に大きな記i1Z iU域は確保しないが多
様な大きさの記憶領域に対する確保処理および解放処理
が多発し、かつ数種類の大きさの記憶領域に対する確保
処理および解放処理が多い場合に、記tq領域の確保処
理および解放処理を高速化できる効果がある。
As explained above, the present invention uses a corresponding type area management table, a mixed type area management table, and a free chain in combination, so that a large storage area is not secured at each time, but storage areas of various sizes can be created. This has the effect of speeding up the process of securing and releasing the tq area when there are many securing and releasing processes for storage areas of several different sizes.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例を示す構成図、第2図は本実
施例の動的記憶領域管理方式における記憶領域の確保処
理を示す流れ図、第3図は本実施例の動的記憶領域管理
方式における記憶領域の解放処理を示す流れ図、第4図
は従来の動的記憶領域管理方式を示す構成図、 第5図はフリーチェインの構成要素となる記憶領域の構
成を示す図である。 図において、 1・・・対応型領域管理表、 2・・・混合型領域管理表、 3・・・フリーチェイン、 4・・・セグメント、 5・・・記i!領域、 21・・・領域サイズ入力ステップ、 22・・・対応型領域管理:p、検索ステップ、23・
・・対応型領域管理表更新ステップ、24・・・混合型
領域管理表検索ステップ、25・・・混合型領域管理表
更新ステップ、26・・・フリーチェーン検索および対
応型領域管理表登録ステップ、 27・・・記憶領域ポインタ出力ステップ、31・・・
記憶領域ポインタ入力ステップ、32・・・対応型領域
管理表登録判定ステップ、33・・・対応型領域管理表
更新ステップ、34・・・混合型領域管理表登録判定ス
テップ、35・・・混合型領域管理表更新ステップ、3
6・・・フリーチェーン格納ステップである。
FIG. 1 is a block diagram showing an embodiment of the present invention, FIG. 2 is a flowchart showing storage area securing processing in the dynamic storage area management method of this embodiment, and FIG. 3 is a dynamic storage area diagram of this embodiment. A flowchart showing the storage area release process in the area management method, FIG. 4 is a configuration diagram showing the conventional dynamic storage area management method, and FIG. 5 is a diagram showing the configuration of the storage area that is a component of the free chain. . In the figure, 1... Corresponding type area management table, 2... Mixed type area management table, 3... Free chain, 4... Segment, 5... Written i! area, 21...area size input step, 22...corresponding area management: p, search step, 23.
... Compatible area management table update step, 24... Mixed area management table search step, 25... Mixed area management table update step, 26... Free chain search and compatible area management table registration step, 27...Storage area pointer output step, 31...
Storage area pointer input step, 32... Compatible type area management table registration determination step, 33... Corresponding type area management table update step, 34... Mixed type area management table registration determination step, 35... Mixed type Area management table update step, 3
6... Free chain storage step.

Claims (1)

【特許請求の範囲】 主記憶領域内の未使用領域へのポインタを未使用領域の
領域サイズで分類して格納する領域サイズ対応型領域管
理表と、 前記主記憶領域内の未使用領域へのポインタを未使用領
域の領域サイズでは分類せずに格納する領域サイズ混合
型領域管理表と、 前記主記憶領域内の前記領域サイズ対応型領域管理表お
よび前記領域サイズ混合型領域管理表のいずれかに登録
された未使用領域を除く未使用領域をアドレスの順にチ
ェインで継いだフリーチェインと、 入力された領域サイズを有する記憶領域を前記領域サイ
ズ対応型領域管理表、前記領域サイズ混合型領域管理表
および前記フリーチェインの優先順位で検索して記憶領
域を確保する記憶領域確保処理手段と、 入力されたポインタで指される記憶領域を前記領域サイ
ズ対応型領域管理表、前記領域サイズ混合型領域管理表
および前記フリーチェインの優先順位で登録して記憶領
域を解放する記憶領域解放処理手段と、 を有することを特徴とする動的記憶領域管理方式。
[Scope of Claims] An area size-aware area management table that stores pointers to unused areas in a main storage area classified by area size of the unused areas; an area size mixed type area management table that stores pointers without classifying them by area size of an unused area, and either the area size compatible type area management table or the area size mixed type area management table in the main storage area. A free chain in which unused areas excluding unused areas registered in are chained in the order of addresses, and a storage area having the input area size in the area size compatible area management table and the area size mixed area management table. a storage area securing processing means for reserving a storage area by searching based on the priority order of the table and the free chain; A dynamic storage area management method comprising: a management table and a storage area release processing means for registering and releasing a storage area in accordance with the priority order of the free chain.
JP20327586A 1986-08-29 1986-08-29 Control system for dynamic memory area Pending JPS6358557A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20327586A JPS6358557A (en) 1986-08-29 1986-08-29 Control system for dynamic memory area

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20327586A JPS6358557A (en) 1986-08-29 1986-08-29 Control system for dynamic memory area

Publications (1)

Publication Number Publication Date
JPS6358557A true JPS6358557A (en) 1988-03-14

Family

ID=16471350

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20327586A Pending JPS6358557A (en) 1986-08-29 1986-08-29 Control system for dynamic memory area

Country Status (1)

Country Link
JP (1) JPS6358557A (en)

Similar Documents

Publication Publication Date Title
US5333318A (en) Creating and searching a quad linked list in a trunked communication system
US20020174109A1 (en) Event detection with concurrent data updates
US11222067B2 (en) Multi-index method and apparatus, cloud system and computer-readable storage medium
US5687377A (en) Method for storing variables in a programming language
CN111008198A (en) Service data acquisition method and device, storage medium and electronic equipment
JPS6358557A (en) Control system for dynamic memory area
US10990575B2 (en) Reorganization of databases by sectioning
JPH03174653A (en) Method and device for control of key word
JPH02156348A (en) Overflow area control method for plural hash tables
US8849866B2 (en) Method and computer program product for creating ordered data structure
JPS6143338A (en) Searching of thin data base using association technology
JPH04112253A (en) Data accessing method using multilayer buffer
CN118132524A (en) Data synchronization method and device, electronic equipment and readable storage medium
JP2003501707A (en) Method and apparatus for element selection using an entire array
JPH04101272A (en) Data element retrieving method
US20060106855A1 (en) Reusable row indices table
CN112182146A (en) Data query method
JPS61278932A (en) Method of processing data addition
JPS63285649A (en) Dead region management processing method
JPS6255765A (en) Method for developing picture of picture file data
EP1141951A2 (en) A digital memory structure and device, and methods for the management thereof
CN117312462A (en) Relationship processing method and device and electronic equipment
JPH10320219A (en) Preferential managing system for resources
JPS6182251A (en) Storing system of relation type data base
JPS62165239A (en) Information retrieving method