Skip to content

Commit 84f359a

Browse files
committed
translating chapter05 some more
1 parent 9f53393 commit 84f359a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

chapter05.textile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ However, it is not because of the reference count, but because it occasionally u
253253

254254
h2. Object Management
255255

256-
`ruby`のGCはRubyオブジェクトのみが対象だ。しかも`ruby`が生成し
257-
管理しているオブジェクトでないといけない。逆に言うとユーザが
258-
勝手に割りあてたメモリまでは面倒を見てくれないということだ。
259-
例えば以下の関数は例え`ruby`が稼働中だろうとメモリリークを起こす。
256+
Ruby's garbage collection is only concerned with ruby objects.
257+
Objects must be created and managed by ruby. In other words
258+
if the user allocates memory by himself ruby want take care of it.
259+
For instance the following function will create a memory leak in ruby.
260260

261261
<pre class="emlist">
262262
void not_ok()
@@ -265,7 +265,7 @@ void not_ok()
265265
}
266266
</pre>
267267

268-
However, the following functions do not cause the memory leak.
268+
However, the following function does not cause the memory leak.
269269

270270
<pre class="emlist">
271271
void this_is_ok()
@@ -294,7 +294,7 @@ The declaration of this union type is as follows.
294294
211 typedef struct RVALUE {
295295
212 union {
296296
213 struct {
297-
214 unsigned long flags; /* 使われていないときはゼロ */
297+
214 unsigned long flags; /* 0 if not used */
298298
215 struct RVALUE *next;
299299
216 } free;
300300
217 struct RBasic basic;
@@ -319,7 +319,7 @@ The declaration of this union type is as follows.
319319
(gc.c)
320320
</pre>
321321

322-
The elements of @struct RVALUE@ is only one @struct@.
322+
The element of @struct RVALUE@ is only one @struct@.
323323
`struct RVALUE`は要素が一つだけの構造体だ。`union`を直接使わないのはデバッ
324324
グや将来の拡張のときに簡単にメンバを増やせるようにするためだそうである。
325325

@@ -355,7 +355,7 @@ The memory for all the object structures has been brought together in global var
355355

356356
@heaps@ is an array of arrays of @struct RVALUE@. The contained arrays
357357
are each a @heap@. The elements of @heap@ are each a @slot@.
358-
(図9)。
358+
(Fig.9)。
359359

360360
!images/ch_gc_heapitems.jpg(Heap slots)!
361361

dictionary.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
予約語:reserved word
1818
特異メソッド:singleton method
1919
型:type (in C)
20-
構造体:structure (in C)
20+
構造体:struct (in C)
21+
共用体:union (in C)
2122
記号:symbol (in a parser input)
2223
文:statement
2324
式:expression

0 commit comments

Comments
 (0)