Commit 659fd08
committed
merge revision(s) r46408,r46410,r46413,r46414,r46424,r46436,r46437: [Backport ruby#9934]
string.c: shrink too big buffer
* string.c (rb_str_resize): shrink the buffer even if new length
is same but it is enough smaller than the capacity.
* file.c (expand_path): shrink expanded path which no longer needs
rooms to append. [ruby-core:63114] [Bug ruby#9934]
* string.c (rb_str_resize): should consider the capacity instead
of the old length, as pointed out by nagachika.
* string.c (rb_str_resize): update capa only when buffer get
reallocated.
http://d.hatena.ne.jp/nagachika/20140613/ruby_trunk_changes_46413_46420#r46413
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e1 parent c65eb7b commit 659fd08
File tree
5 files changed
+49
-10
lines changed- test/ruby
5 files changed
+49
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
1 | 17 | | |
2 | 18 | | |
3 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3397 | 3397 | | |
3398 | 3398 | | |
3399 | 3399 | | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
3400 | 3410 | | |
3401 | 3411 | | |
3402 | 3412 | | |
| |||
3411 | 3421 | | |
3412 | 3422 | | |
3413 | 3423 | | |
3414 | | - | |
| 3424 | + | |
3415 | 3425 | | |
3416 | 3426 | | |
3417 | 3427 | | |
3418 | 3428 | | |
3419 | 3429 | | |
3420 | | - | |
| 3430 | + | |
3421 | 3431 | | |
3422 | 3432 | | |
3423 | 3433 | | |
| |||
3465 | 3475 | | |
3466 | 3476 | | |
3467 | 3477 | | |
3468 | | - | |
| 3478 | + | |
3469 | 3479 | | |
3470 | 3480 | | |
3471 | 3481 | | |
| |||
5408 | 5418 | | |
5409 | 5419 | | |
5410 | 5420 | | |
| 5421 | + | |
5411 | 5422 | | |
5412 | 5423 | | |
5413 | 5424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2034 | 2034 | | |
2035 | 2035 | | |
2036 | 2036 | | |
2037 | | - | |
| 2037 | + | |
| 2038 | + | |
2038 | 2039 | | |
2039 | 2040 | | |
| 2041 | + | |
2040 | 2042 | | |
2041 | 2043 | | |
2042 | 2044 | | |
| |||
2056 | 2058 | | |
2057 | 2059 | | |
2058 | 2060 | | |
| 2061 | + | |
2059 | 2062 | | |
2060 | 2063 | | |
2061 | | - | |
| 2064 | + | |
| 2065 | + | |
2062 | 2066 | | |
2063 | | - | |
2064 | | - | |
2065 | 2067 | | |
2066 | 2068 | | |
| 2069 | + | |
2067 | 2070 | | |
2068 | 2071 | | |
2069 | 2072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
461 | 470 | | |
462 | 471 | | |
463 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments