unicorn 0.96.0 → 0.96.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/GIT-VERSION-GEN +1 -1
- data/ext/unicorn_http/unicorn_http.rl +1 -1
- data/lib/unicorn/const.rb +1 -1
- data/test/unit/test_http_parser.rb +17 -1
- metadata +2 -2
data/GIT-VERSION-GEN
CHANGED
@@ -439,7 +439,7 @@ static void hp_mark(void *ptr)
|
|
439
439
|
static VALUE HttpParser_alloc(VALUE klass)
|
440
440
|
{
|
441
441
|
struct http_parser *hp;
|
442
|
-
return Data_Make_Struct(klass, struct http_parser, hp_mark,
|
442
|
+
return Data_Make_Struct(klass, struct http_parser, hp_mark, -1, hp);
|
443
443
|
}
|
444
444
|
|
445
445
|
|
data/lib/unicorn/const.rb
CHANGED
@@ -7,7 +7,7 @@ module Unicorn
|
|
7
7
|
# gave about a 3% to 10% performance improvement over using the strings directly.
|
8
8
|
# Symbols did not really improve things much compared to constants.
|
9
9
|
module Const
|
10
|
-
UNICORN_VERSION="0.96.
|
10
|
+
UNICORN_VERSION="0.96.1"
|
11
11
|
|
12
12
|
DEFAULT_HOST = "0.0.0.0" # default TCP listen host address
|
13
13
|
DEFAULT_PORT = 8080 # default TCP listen port
|
@@ -527,5 +527,21 @@ class HttpParserTest < Test::Unit::TestCase
|
|
527
527
|
end
|
528
528
|
|
529
529
|
end
|
530
|
-
end
|
531
530
|
|
531
|
+
# so we don't care about the portability of this test
|
532
|
+
# if it doesn't leak on Linux, it won't leak anywhere else
|
533
|
+
# unless your C compiler or platform is otherwise broken
|
534
|
+
LINUX_PROC_PID_STATUS = "/proc/self/status"
|
535
|
+
def test_memory_leak
|
536
|
+
match_rss = /^VmRSS:\s+(\d+)/
|
537
|
+
if File.read(LINUX_PROC_PID_STATUS) =~ match_rss
|
538
|
+
before = $1.to_i
|
539
|
+
1000000.times { Unicorn::HttpParser.new }
|
540
|
+
File.read(LINUX_PROC_PID_STATUS) =~ match_rss
|
541
|
+
after = $1.to_i
|
542
|
+
diff = after - before
|
543
|
+
assert(diff < 10000, "memory grew more than 10M: #{diff}")
|
544
|
+
end
|
545
|
+
end if RUBY_PLATFORM =~ /linux/ && test(?r, LINUX_PROC_PID_STATUS)
|
546
|
+
|
547
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.96.
|
4
|
+
version: 0.96.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Unicorn hackers
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-
|
12
|
+
date: 2010-02-13 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|