Skip to content

Commit 474e5bd

Browse files
committed
* remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 215c40b commit 474e5bd

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

README.EXT

+37-37
Original file line numberDiff line numberDiff line change
@@ -1493,25 +1493,25 @@ RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
14931493
See documentation for {mkmf}[rdoc-ref:MakeMakefile].
14941494
= Appendix D. Generational GC
14951495

1496-
Ruby 2.1 introduced a generational garbage collector (called RGenGC).
1496+
Ruby 2.1 introduced a generational garbage collector (called RGenGC).
14971497
RGenGC (mostly) keeps compatibility.
14981498

1499-
Generally, the use of the technique called write barriers is required in
1500-
extension libraries for generational GC
1501-
(http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29).
1499+
Generally, the use of the technique called write barriers is required in
1500+
extension libraries for generational GC
1501+
(http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29).
15021502
RGenGC works fine without write barriers in extension libraries.
1503-
1503+
15041504
If your library adheres to the following tips, performance can
15051505
be further improved. Especially, the "Don't touch pointers directly" section is
15061506
important.
15071507

15081508
== Incompatibility
1509-
1510-
You can't write RBASIC(obj)->klass field directly because it is const
1509+
1510+
You can't write RBASIC(obj)->klass field directly because it is const
15111511
value now.
15121512

1513-
Basically you should not write this field because MRI expects it to be
1514-
an immutable field, but if you want to do it in your extension you can
1513+
Basically you should not write this field because MRI expects it to be
1514+
an immutable field, but if you want to do it in your extension you can
15151515
use the following functions:
15161516

15171517
VALUE rb_obj_hide(VALUE obj) ::
@@ -1526,65 +1526,65 @@ VALUE rb_obj_reveal(VALUE obj, VALUE klass) ::
15261526

15271527
== Write barriers
15281528

1529-
RGenGC doesn't require write barriers to support generational GC.
1530-
However, caring about write barrier can improve the performance of
1529+
RGenGC doesn't require write barriers to support generational GC.
1530+
However, caring about write barrier can improve the performance of
15311531
RGenGC. Please check the following tips.
1532-
1532+
15331533
=== Don't touch pointers directly
1534-
1535-
In MRI (include/ruby/ruby.h), some macros to acquire pointers to the
1536-
internal data structures are supported such as RARRAY_PTR(),
1534+
1535+
In MRI (include/ruby/ruby.h), some macros to acquire pointers to the
1536+
internal data structures are supported such as RARRAY_PTR(),
15371537
RSTRUCT_PTR() and so on.
15381538

1539-
DO NOT USE THESE MACROS and instead use the corresponding C-APIs such as
1539+
DO NOT USE THESE MACROS and instead use the corresponding C-APIs such as
15401540
rb_ary_aref(), rb_ary_store() and so on.
15411541

15421542
=== Consider whether to insert write barriers
15431543

1544-
You don't need to care about write barriers if you only use built-in
1544+
You don't need to care about write barriers if you only use built-in
15451545
types.
15461546

15471547
If you support T_DATA objects, you may consider using write barriers.
15481548

1549-
Inserting write barriers into T_DATA objects only works with the
1550-
following type objects: (a) long-lived objects, (b) when a huge number
1551-
of objects are generated and (c) container-type objects that have
1552-
references to other objects. If your extension provides such a type of
1549+
Inserting write barriers into T_DATA objects only works with the
1550+
following type objects: (a) long-lived objects, (b) when a huge number
1551+
of objects are generated and (c) container-type objects that have
1552+
references to other objects. If your extension provides such a type of
15531553
T_DATA objects, consider inserting write barriers.
15541554

15551555
(a): short-lived objects don't become old generation objects.
15561556
(b): only a few oldgen objects don't have performance impact.
15571557
(c): only a few references don't have performance impact.
1558-
1559-
Inserting write barriers is a very difficult hack, it is easy to
1560-
introduce critical bugs. And inserting write barriers has several areas
1561-
of overhead. Basically we don't recommend you insert write barriers.
1558+
1559+
Inserting write barriers is a very difficult hack, it is easy to
1560+
introduce critical bugs. And inserting write barriers has several areas
1561+
of overhead. Basically we don't recommend you insert write barriers.
15621562
Please carefully consider the risks.
15631563

15641564
=== Combine with built-in types
15651565

1566-
Please consider utilizing built-in types. Most built-in types support
1567-
write barrier, so you can use them to avoid manually inserting write
1566+
Please consider utilizing built-in types. Most built-in types support
1567+
write barrier, so you can use them to avoid manually inserting write
15681568
barriers.
15691569

1570-
For example, if your T_DATA has references to other objects, then you
1571-
can move these references to Array. A T_DATA object only has a reference
1572-
to an array object. Or you can also use a Struct object to gather a
1573-
T_DATA object (without any references) and an that Array contains
1570+
For example, if your T_DATA has references to other objects, then you
1571+
can move these references to Array. A T_DATA object only has a reference
1572+
to an array object. Or you can also use a Struct object to gather a
1573+
T_DATA object (without any references) and an that Array contains
15741574
references.
15751575

1576-
With use of such techniques, you don't need to insert write barriers
1576+
With use of such techniques, you don't need to insert write barriers
15771577
anymore.
15781578

15791579
=== Insert write barriers
15801580

1581-
[AGAIN] Inserting write barriers is a very difficult hack, and it is
1582-
easy to introduce critical bugs. And inserting write barriers has
1583-
several areas of overhead. Basically we don't recommend you insert write
1581+
[AGAIN] Inserting write barriers is a very difficult hack, and it is
1582+
easy to introduce critical bugs. And inserting write barriers has
1583+
several areas of overhead. Basically we don't recommend you insert write
15841584
barriers. Please carefully consider the risks.
15851585

1586-
Before inserting write barriers, you need to know about RGenGC algorithm
1587-
(gc.c will help you). Macros and functions to insert write barriers are
1586+
Before inserting write barriers, you need to know about RGenGC algorithm
1587+
(gc.c will help you). Macros and functions to insert write barriers are
15881588
available in in include/ruby/ruby.h. An example is available in iseq.c.
15891589

15901590
For a complete guide for RGenGC and write barriers, please refer to [...].

README.EXT.ja

+2-2
Original file line numberDiff line numberDiff line change
@@ -1637,10 +1637,10 @@ RGenGCは、過去の拡張ライブラリに(ほぼ)互換性を保つよ
16371637
拡張ライブラリに高い性能が必要である場合は対応を検討して下さい。
16381638

16391639
とくにRARRAY_PTR()/RHASH_PTR()のようなマクロを用いてポインタに直接アクセ
1640-
スするようなコードは書かないようにして下さい。代わりに、rb_ary_aref(),
1640+
スするようなコードは書かないようにして下さい。代わりに、rb_ary_aref(),
16411641
rb_ary_store() などの、適切な API 関数を利用するようにして下さい。
16421642

1643-
そのほか、対応についての詳細は README.ext の「Appendix D. Generational
1643+
そのほか、対応についての詳細は README.ext の「Appendix D. Generational
16441644
GC」を参照して下さい。
16451645

16461646
/*

0 commit comments

Comments
 (0)