Skip to content

Commit a1b57d0

Browse files
author
matz
committed
1.4.1 to be
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent a281c99 commit a1b57d0

32 files changed

+211
-435
lines changed

ChangeLog

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
Sat Aug 21 11:30:51 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
2+
3+
* eval.c (ADJ): should not adjust addresses to data on heap.
4+
5+
Fri Aug 20 20:50:58 1999 Kenji Nagasawa <kenn@hma.att.ne.jp>
6+
7+
* defines.h (PATH_SEP): path separator is ";" for OS/2.
8+
9+
Thu Aug 19 10:50:43 1999 WATANABE Tetsuya <tetsu@jpn.hp.com>
10+
11+
* gc.c (rb_gc): add volatile to avoid GCC optimaize bug(?).
12+
13+
Wed Aug 18 23:48:10 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
14+
15+
* due to disk trouble, some change records were lost. several
16+
modification made to eval.c, gc.c, io.c, pack.c,
17+
ext/extmk.rb.in, and lib/mkmf.rb.
18+
119
Fri Aug 13 15:41:39 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
220

321
* stable version 1.4.0 released.

MANIFEST

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ cygwin/GNUmakefile.in
8080
ext/Setup
8181
ext/Setup.dj
8282
ext/Setup.emx
83-
ext/Setup.nt
8483
ext/Setup.x68
8584
ext/aix_mksym.rb
8685
ext/mswin32_extmk.rb

README.EXT

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" README.EXT - -*- Text -*- created at: Mon Aug 7 16:45:54 JST 1995
22

3-
This document explains how to make extention libraries for Ruby.
3+
This document explains how to make extension libraries for Ruby.
44

55
1. Basic knowledge
66

@@ -16,23 +16,23 @@ To retrieve an C data from the VALUE, you need to:
1616
(1) Identify VALUE's data type
1717
(2) Convert VALUE into C data
1818

19-
Converting to wrong data type may cause serious promblems.
19+
Converting to wrong data type may cause serious problems.
2020

2121

2222
1.1 Data-types
2323

2424
Ruby interpreter has data-types as below:
2525

2626
T_NIL nil
27-
T_OBJECT ordinaly object
27+
T_OBJECT ordinary object
2828
T_CLASS class
2929
T_MODULE module
3030
T_FLOAT floating point number
3131
T_STRING string
3232
T_REGEXP regular expression
3333
T_ARRAY array
3434
T_FIXNUM Fixnum(31bit integer)
35-
T_HASH assosiative array
35+
T_HASH associative array
3636
T_STRUCT (Ruby) structure
3737
T_BIGNUM multi precision integer
3838
T_TRUE true
@@ -88,7 +88,7 @@ The data for type T_NIL, T_FALSE, T_TRUE are nil, true, false
8888
respectively. They are singletons for the data type.
8989

9090
The T_FIXNUM data is the 31bit length fixed integer (63bit length on
91-
some machines), which can be conver to the C integer by using
91+
some machines), which can be convert to the C integer by using
9292
FIX2INT() macro. There also be NUM2INT() which converts any Ruby
9393
numbers into C integer. The NUM2INT() macro includes type check, so
9494
the exception will be raised if conversion failed.
@@ -127,7 +127,7 @@ structures are defined in <ruby.h>.
127127

128128
To convert C numbers to Ruby value, use these macros.
129129

130-
INT2FIX() for intergers within 31bits.
130+
INT2FIX() for integers within 31bits.
131131
INT2NUM() for arbitrary sized integer.
132132

133133
INT2NUM() converts integers into Bignums, if it is out of FIXNUM
@@ -139,7 +139,7 @@ As I already told, it is not recommended to modify object's internal
139139
structure. To manipulate objects, use functions supplied by Ruby
140140
interpreter. Useful functions are listed below (not all):
141141

142-
String funtions
142+
String functions
143143

144144
rb_str_new(char *ptr, int len)
145145

@@ -200,14 +200,14 @@ To define class or module, use functions below:
200200
VALUE rb_define_class(char *name, VALUE super)
201201
VALUE rb_define_module(char *name)
202202

203-
These functions return the newly created class ot module. You may
203+
These functions return the newly created class or module. You may
204204
want to save this reference into the variable to use later.
205205

206206
2.1.2 Method/singleton method definition
207207

208208
To define methods or singleton methods, use functions below:
209209

210-
void rb_define_method(VALUE class, char *name,
210+
void rb_define_method(VALUE klass, char *name,
211211
VALUE (*func)(), int argc)
212212

213213
void rb_define_singleton_method(VALUE object, char *name,
@@ -237,7 +237,7 @@ actual arguments.
237237
There're two more functions to define method. One is to define
238238
private method:
239239

240-
void rb_define_private_method(VALUE class, char *name,
240+
void rb_define_private_method(VALUE klass, char *name,
241241
VALUE (*func)(), int argc)
242242

243243
The other is to define module function, which is private AND singleton
@@ -266,7 +266,7 @@ in Kernel module, can be defined using:
266266

267267
We have 2 functions to define constants:
268268

269-
void rb_define_const(VALUE class, char *name, VALUE val)
269+
void rb_define_const(VALUE klass, char *name, VALUE val)
270270
void rb_define_global_const(char *name, VALUE val)
271271

272272
The former is to define constant under specified class/module. The
@@ -330,7 +330,7 @@ To access the constants of the class/module:
330330

331331
See 2.1.3 for defining new constant.
332332

333-
3. Informatin sharing between Ruby and C
333+
3. Information sharing between Ruby and C
334334

335335
3.1 Ruby constant that C can be accessed from C
336336

@@ -353,7 +353,7 @@ variables. To define them, you can use functions listed below:
353353
void rb_define_variable(char *name, VALUE *var)
354354

355355
This function defines the variable which is shared by the both world.
356-
The value of the global variable pointerd by `var', can be accessed
356+
The value of the global variable pointed by `var', can be accessed
357357
through Ruby's global variable named `name'.
358358

359359
You can define read-only (from Ruby, of course) variable by the
@@ -387,7 +387,7 @@ The prototypes of the getter and setter functions are as following:
387387
To wrapping and objectify the C pointer as Ruby object (so called
388388
DATA), use Data_Wrap_Struct().
389389

390-
Data_Wrap_Struct(class,mark,free,ptr)
390+
Data_Wrap_Struct(klass,mark,free,ptr)
391391

392392
Data_Wrap_Struct() returns a created DATA object. The class argument
393393
is the class for the DATA object. The mark argument is the function
@@ -397,14 +397,14 @@ free, will be called from garbage collector.
397397

398398
You can allocate and wrap the structure in one step.
399399

400-
Data_Make_Struct(class, type, mark, free, sval)
400+
Data_Make_Struct(klass, type, mark, free, sval)
401401

402402
This macro returns an allocated Data object, wrapping the pointer to
403403
the structure, which is also allocated. This macro works like:
404404

405-
(sval = ALLOC(type), Data_Wrap_Struct(class, mark, free, sval))
405+
(sval = ALLOC(type), Data_Wrap_Struct(klass, mark, free, sval))
406406

407-
Arguments, class, mark, free, works like thier counterpart of
407+
Arguments, klass, mark, free, works like their counterpart of
408408
Data_Wrap_Struct(). The pointer to allocated structure will be
409409
assigned to sval, which should be the pointer to the type specified.
410410

@@ -445,12 +445,12 @@ You need to design the library features, before making it.
445445

446446
You need to write C code for your extension library. If your library
447447
has only one source file, choosing ``LIBRARY.c'' as a file name is
448-
preferred. On the other hand, in case your library has prural source
449-
files, avoid chooing ``LIBRARY.c'' for a file name. It may conflict
448+
preferred. On the other hand, in case your library has plural source
449+
files, avoid choosing ``LIBRARY.c'' for a file name. It may conflict
450450
with intermediate file ``LIBRARY.o'' on some platforms.
451451

452452
Ruby will execute the initializing function named ``Init_LIBRARY'' in
453-
the library. For exapmle, ``Init_dbm()'' will be executed when loading
453+
the library. For example, ``Init_dbm()'' will be executed when loading
454454
the library.
455455

456456
Here's the example of an initializing function.
@@ -484,7 +484,7 @@ struct dbmdata {
484484
};
485485

486486

487-
obj = Data_Make_Struct(class,struct dbmdata,0,free_dbm,dbmp);
487+
obj = Data_Make_Struct(klass,struct dbmdata,0,free_dbm,dbmp);
488488
--
489489

490490
This code wraps dbmdata structure into Ruby object. We avoid wrapping
@@ -517,15 +517,15 @@ fdbm_delete(obj, keystr)
517517
The first argument of the C function is the self, the rest are the
518518
arguments to the method.
519519

520-
Second, the methods with arbtrary number of arguments receives
520+
Second, the methods with arbitrary number of arguments receives
521521
arguments like this:
522522

523523
--
524524
static VALUE
525-
fdbm_s_open(argc, argv, class)
525+
fdbm_s_open(argc, argv, klass)
526526
int argc;
527527
VALUE *argv;
528-
VALUE class;
528+
VALUE klass;
529529
{
530530
:
531531
if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
@@ -540,10 +540,10 @@ argument is the C array of the method arguments. And the third
540540
argument is the receiver of the method.
541541

542542
You can use the function rb_scan_args() to check and retrieve the
543-
arguments. For exapmle "11" means, the method requires at least one
543+
arguments. For example "11" means, the method requires at least one
544544
argument, and at most receives two arguments.
545545

546-
The methods with arbtrary number of arguments can receives arguments
546+
The methods with arbitrary number of arguments can receives arguments
547547
by Ruby's array, like this:
548548

549549
--
@@ -576,7 +576,7 @@ need to put
576576

577577
require 'mkmf'
578578

579-
at the top of the file. You can use the funcitons below to check the
579+
at the top of the file. You can use the functions below to check the
580580
condition.
581581

582582
have_library(lib, func): check whether library containing function exists.
@@ -720,14 +720,14 @@ const: false object
720720

721721
** C pointer wrapping
722722

723-
Data_Wrap_Struct(VALUE class, void (*mark)(), void (*free)(), void *sval)
723+
Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval)
724724

725725
Wrap C pointer into Ruby object. If object has references to other
726726
Ruby object, they should be marked by using mark function during GC
727727
process. Otherwise, mark should be 0. When this object is no longer
728728
referred by anywhere, the pointer will be discarded by free function.
729729

730-
Data_Make_Struct(class, type, mark, free, sval)
730+
Data_Make_Struct(klass, type, mark, free, sval)
731731

732732
This macro allocates memory using malloc(), assigns it to the variable
733733
sval, and returns the DATA encapsulating the pointer to memory region.
@@ -754,9 +754,9 @@ Defines new Ruby module.
754754

755755
VALUE rb_define_module_under(VALUE module, char *name, VALUE super)
756756

757-
Defines new Ruby module, under the modules's namespace.
757+
Defines new Ruby module, under the module's namespace.
758758

759-
void rb_include_module(VALUE class, VALUE module)
759+
void rb_include_module(VALUE klass, VALUE module)
760760

761761
Includes module into class. If class already includes it, just
762762
ignore.
@@ -817,34 +817,34 @@ Defines a new constant under the class/module.
817817

818818
void rb_define_global_const(char *name, VALUE val)
819819

820-
Defines global contant. This is just work as
820+
Defines global constant. This is just work as
821821

822822
rb_define_const(cKernal, name, val)
823823

824824
** Method Definition
825825

826-
rb_define_method(VALUE class, char *name, VALUE (*func)(), int argc)
826+
rb_define_method(VALUE klass, char *name, VALUE (*func)(), int argc)
827827

828828
Defines a method for the class. func is the function pointer. argc
829829
is the number of arguments. if argc is -1, the function will receive
830830
3 arguments argc, argv, and self. if argc is -2, the function will
831831
receive 2 arguments, self and args, where args is the Ruby array of
832832
the method arguments.
833833

834-
rb_define_private_method(VALUE class, char *name, VALUE (*func)(), int argc)
834+
rb_define_private_method(VALUE klass, char *name, VALUE (*func)(), int argc)
835835

836836
Defines a private method for the class. Arguments are same as
837837
rb_define_method().
838838

839-
rb_define_singleton_method(VALUE class, char *name, VALUE (*func)(), int argc)
839+
rb_define_singleton_method(VALUE klass, char *name, VALUE (*func)(), int argc)
840840

841841
Defines a singleton method. Arguments are same as rb_define_method().
842842

843843
rb_scan_args(int argc, VALUE *argv, char *fmt, ...)
844844

845845
Retrieve argument from argc, argv. The fmt is the format string for
846-
the arguments, such as "12" for 1 non-optinal argument, 2 optinal
847-
aruguments. If `*' appears at the end of fmt, it means the rest of
846+
the arguments, such as "12" for 1 non-optional argument, 2 optional
847+
arguments. If `*' appears at the end of fmt, it means the rest of
848848
the arguments are assigned to corresponding variable, packed in
849849
array.
850850

@@ -870,7 +870,7 @@ Returns ID corresponding the name.
870870

871871
Returns the name corresponding ID.
872872

873-
char *rb_class2name(VALUE class)
873+
char *rb_class2name(VALUE klass)
874874

875875
Returns the name of the class.
876876

@@ -934,7 +934,7 @@ will be done for fatal error, but ensure blocks will be executed.
934934

935935
void rb_bug(char *fmt, ...)
936936

937-
Termintates the interpreter immediately. This function should be
937+
Terminates the interpreter immediately. This function should be
938938
called under the situation caused by the bug in the interpreter. No
939939
exception handling nor ensure execution will be done.
940940

README.jp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Ruby
3939
CVS password: guest
4040
$ cvs -d :pserver:anonymous@cvs.netlab.co.jp:/home/cvs checkout ruby
4141

42+
4243
* �ۡ���ڡ���
4344

4445
Ruby�Υۡ���ڡ�����URL��
@@ -134,7 +135,7 @@ UNIX
134135

135136
* ���۾��
136137

137-
RUby�ϥե꡼���եȥ������Ǥ���GPL(the GNU General Public
138+
Ruby�ϥե꡼���եȥ������Ǥ���GPL(the GNU General Public
138139
Licence)�ޤ��ϰʲ��˼�������Ruby������ۤǤ��ޤ���GPL�ˤ�
139140
���Ƥ�COPYING�ե�����򻲾Ȥ��Ʋ�������
140141

@@ -171,7 +172,7 @@ Licence)
171172
4. ¾�Υץ������ؤΰ��ѤϤ����ʤ���Ū�Ǥ��켫ͳ�Ǥ�����
172173
������Ruby�˴ޤޤ��¾�κ�Ԥˤ�륳���ɤϡ����줾���
173174
��Ԥΰո��ˤ�����¤��ä����ޤ�������Ū�ˤ�gc.c(����)��
174-
util.c(����)��st.[ch]��regex.[ch] �����. /missing�ǥ�
175+
util.c(����)��st.[ch]��regex.[ch] ����� ./missing�ǥ�
175176
�쥯�ȥ겼�Υե����뷲���������ޤ������줾������۾��
176177
�ʤɤ��դ��Ƥϳƥե�����򻲾Ȥ��Ƥ���������
177178

defines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#define DOSISH 1
4949
#endif
5050

51-
#if defined(MSDOS) || defined(NT) || defined(__human68k__)
51+
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(OS2)
5252
#define PATH_SEP ";"
5353
#else
5454
#define PATH_SEP ":"

eval.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5359,7 +5359,7 @@ blk_copy_prev(block)
53595359
MEMCPY(tmp, block->prev, struct BLOCK, 1);
53605360
if (tmp->frame.argc > 0) {
53615361
tmp->frame.argv = ALLOC_N(VALUE, tmp->frame.argc);
5362-
MEMCPY(tmp->frame.argv, block->frame.argv, VALUE, tmp->frame.argc);
5362+
MEMCPY(tmp->frame.argv, block->prev->frame.argv, VALUE, tmp->frame.argc);
53635363
}
53645364
scope_dup(tmp->scope);
53655365
block->prev = tmp;
@@ -6016,8 +6016,8 @@ timeofday()
60166016

60176017
static thread_t main_thread;
60186018

6019-
#define ADJ(addr) (void*)(((VALUE*)(addr)-th->stk_pos)+th->stk_ptr)
6020-
#define STACK(addr) (th->stk_pos<(addr) && (addr)<th->stk_pos+th->stk_len)
6019+
#define STACK(addr) (th->stk_pos<(VALUE*)(addr) && (VALUE*)(addr)<th->stk_pos+th->stk_len)
6020+
#define ADJ(addr) (void*)(STACK(addr)?(((VALUE*)(addr)-th->stk_pos)+th->stk_ptr):(VALUE*)(addr))
60216021

60226022
static void
60236023
thread_mark(th)
@@ -6041,6 +6041,7 @@ thread_mark(th)
60416041
rb_mark_tbl(th->locals);
60426042

60436043
/* mark data in copied stack */
6044+
if (th == curr_thread) return;
60446045
if (th->status == THREAD_KILLED) return;
60456046
if (th->stk_len == 0) return; /* stack not active, no need to mark. */
60466047
if (th->stk_ptr) {
@@ -6054,7 +6055,7 @@ thread_mark(th)
60546055
frame = ADJ(frame);
60556056
rb_gc_mark_frame(frame);
60566057
if (frame->tmp) {
6057-
struct FRAME *tmp = ADJ(frame->tmp);
6058+
struct FRAME *tmp = frame->tmp;
60586059

60596060
while (tmp && tmp != top_frame) {
60606061
tmp = ADJ(tmp);

0 commit comments

Comments
 (0)