je 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +11 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +20 -0
- data/Rakefile +17 -0
- data/bin/je +12 -0
- data/ext/jemalloc/extconf.rb +26 -0
- data/ext/jemalloc/jemalloc-3.0.0.tar.bz2 +0 -0
- data/je.gemspec +23 -0
- data/lib/je/version.rb +3 -0
- metadata +88 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
je (0.5.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
rake (0.9.2.2)
|
10
|
+
rake-compiler (0.7.9)
|
11
|
+
rake
|
12
|
+
|
13
|
+
PLATFORMS
|
14
|
+
ruby
|
15
|
+
|
16
|
+
DEPENDENCIES
|
17
|
+
bundler (>= 1.0.0)
|
18
|
+
je!
|
19
|
+
rake (>= 0.8.7)
|
20
|
+
rake-compiler (~> 0.7.1)
|
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- mode: ruby; coding: utf-8 -*-
|
2
|
+
require 'rubygems'
|
3
|
+
require 'bundler'
|
4
|
+
|
5
|
+
require 'rake'
|
6
|
+
require 'rake/clean'
|
7
|
+
require 'rake/testtask'
|
8
|
+
require 'rubygems/package_task'
|
9
|
+
|
10
|
+
Bundler::GemHelper.install_tasks
|
11
|
+
|
12
|
+
begin
|
13
|
+
require 'rake/extensiontask'
|
14
|
+
Rake::ExtensionTask.new('jemalloc')
|
15
|
+
rescue LoadError
|
16
|
+
abort "This Rakefile requires rake-compiler (gem install rake-compiler)"
|
17
|
+
end
|
data/bin/je
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
lib_dir = File.expand_path('../lib/', File.dirname(__FILE__))
|
4
|
+
jemalloc_path = lib_dir + "/jemalloc.so"
|
5
|
+
ENV.store("LD_PRELOAD", jemalloc_path)
|
6
|
+
|
7
|
+
pid = Process.fork
|
8
|
+
if pid.nil? then
|
9
|
+
Kernel.exec *ARGV
|
10
|
+
else
|
11
|
+
pid, status = Process.wait2
|
12
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'mkmf'
|
2
|
+
require File.expand_path('../../lib/je/version', File.dirname(__FILE__))
|
3
|
+
|
4
|
+
$stdout.sync = true
|
5
|
+
pkg = "jemalloc-3.0.0"
|
6
|
+
|
7
|
+
cur_dir = Dir.pwd
|
8
|
+
Dir.chdir File.dirname(__FILE__) do
|
9
|
+
# cleanup
|
10
|
+
puts `rm -fR #{pkg}`
|
11
|
+
puts `tar vjxf #{pkg}.tar.bz2`
|
12
|
+
Dir.chdir(pkg) do
|
13
|
+
# configure
|
14
|
+
puts `./configure`
|
15
|
+
# mkmf only allows *.c file on current dir
|
16
|
+
puts `cp src/*.c ../`
|
17
|
+
# zone.c is only for OS X Lion
|
18
|
+
puts `rm -fR ../zone.c`
|
19
|
+
end
|
20
|
+
end
|
21
|
+
Dir.chdir cur_dir
|
22
|
+
|
23
|
+
include_dir= File.dirname(__FILE__) + "/#{pkg}/include/"
|
24
|
+
$CFLAGS << %[ -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -D_GNU_SOURCE -D_REENTRANT -I.. -I#{include_dir}]
|
25
|
+
|
26
|
+
create_makefile('jemalloc')
|
Binary file
|
data/je.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- mode: ruby; coding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require 'je/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "je"
|
7
|
+
s.version = JE::VERSION
|
8
|
+
s.summary = "use jemalloc as default allocator, everywhere!"
|
9
|
+
s.description = %q{Use jemalloc as default allocator, everywhere!}
|
10
|
+
s.author = "Kazuki Ohta"
|
11
|
+
s.email = "kazuki.ohta@gmail.com"
|
12
|
+
s.homepage = "https://github.com/treasure-data/je"
|
13
|
+
s.extensions = ["ext/jemalloc/extconf.rb"]
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
|
20
|
+
s.add_development_dependency 'bundler', ['>= 1.0.0']
|
21
|
+
s.add_development_dependency 'rake', ['>= 0.8.7']
|
22
|
+
s.add_development_dependency 'rake-compiler', ['~> 0.7.1']
|
23
|
+
end
|
data/lib/je/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: je
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Kazuki Ohta
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-08-04 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: &14583080 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.0.0
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *14583080
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake
|
27
|
+
requirement: &14582560 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.8.7
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *14582560
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rake-compiler
|
38
|
+
requirement: &14582080 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.7.1
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *14582080
|
47
|
+
description: Use jemalloc as default allocator, everywhere!
|
48
|
+
email: kazuki.ohta@gmail.com
|
49
|
+
executables:
|
50
|
+
- je
|
51
|
+
extensions:
|
52
|
+
- ext/jemalloc/extconf.rb
|
53
|
+
extra_rdoc_files: []
|
54
|
+
files:
|
55
|
+
- .gitignore
|
56
|
+
- Gemfile
|
57
|
+
- Gemfile.lock
|
58
|
+
- Rakefile
|
59
|
+
- bin/je
|
60
|
+
- ext/jemalloc/extconf.rb
|
61
|
+
- ext/jemalloc/jemalloc-3.0.0.tar.bz2
|
62
|
+
- je.gemspec
|
63
|
+
- lib/je/version.rb
|
64
|
+
homepage: https://github.com/treasure-data/je
|
65
|
+
licenses: []
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
78
|
+
requirements:
|
79
|
+
- - ! '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
requirements: []
|
83
|
+
rubyforge_project:
|
84
|
+
rubygems_version: 1.8.10
|
85
|
+
signing_key:
|
86
|
+
specification_version: 3
|
87
|
+
summary: use jemalloc as default allocator, everywhere!
|
88
|
+
test_files: []
|