├── .DS_Store ├── 00-RELEASENOTES ├── BUGS ├── CONTRIBUTING ├── COPYING ├── INSTALL ├── MANIFESTO ├── Makefile ├── README.markdown ├── deps ├── .DS_Store ├── .make-cflags ├── .make-ldflags ├── .make-prerequisites ├── Makefile ├── gperftools-2.0 │ ├── .deps │ │ ├── addressmap_unittest-addressmap_unittest.Po │ │ ├── addressmap_unittest-port.Po │ │ ├── atomicops-internals-x86.Plo │ │ ├── atomicops_unittest.Po │ │ ├── current_allocated_bytes_test-current_allocated_bytes_test.Po │ │ ├── debugallocation_test-debugallocation_test.Po │ │ ├── dynamic_annotations.Plo │ │ ├── elf_mem_image.Plo │ │ ├── frag_unittest-frag_unittest.Po │ │ ├── getpc_test.Po │ │ ├── heap_checker_debug_unittest-heap-checker_unittest.Po │ │ ├── heap_checker_unittest-heap-checker_unittest.Po │ │ ├── heap_profiler_debug_unittest-heap-profiler_unittest.Po │ │ ├── heap_profiler_unittest-heap-profiler_unittest.Po │ │ ├── ia32_modrm_map.Plo │ │ ├── ia32_opcode_map.Plo │ │ ├── libtcmalloc_and_profiler_la-heap-checker-bcad.Plo │ │ ├── libtcmalloc_and_profiler_la-heap-checker.Plo │ │ ├── libtcmalloc_and_profiler_la-linuxthreads.Plo │ │ ├── libtcmalloc_and_profiler_la-profile-handler.Plo │ │ ├── libtcmalloc_and_profiler_la-profiledata.Plo │ │ ├── libtcmalloc_and_profiler_la-profiler.Plo │ │ ├── libtcmalloc_and_profiler_la-tcmalloc.Plo │ │ ├── libtcmalloc_debug_la-debugallocation.Plo │ │ ├── libtcmalloc_debug_la-heap-checker-bcad.Plo │ │ ├── libtcmalloc_debug_la-heap-checker.Plo │ │ ├── libtcmalloc_debug_la-linuxthreads.Plo │ │ ├── libtcmalloc_internal_la-central_freelist.Plo │ │ ├── libtcmalloc_internal_la-common.Plo │ │ ├── libtcmalloc_internal_la-heap-profile-table.Plo │ │ ├── libtcmalloc_internal_la-heap-profiler.Plo │ │ ├── libtcmalloc_internal_la-internal_logging.Plo │ │ ├── libtcmalloc_internal_la-low_level_alloc.Plo │ │ ├── libtcmalloc_internal_la-malloc_extension.Plo │ │ ├── libtcmalloc_internal_la-malloc_hook.Plo │ │ ├── libtcmalloc_internal_la-maybe_threads.Plo │ │ ├── libtcmalloc_internal_la-memfs_malloc.Plo │ │ ├── libtcmalloc_internal_la-memory_region_map.Plo │ │ ├── libtcmalloc_internal_la-page_heap.Plo │ │ ├── libtcmalloc_internal_la-raw_printer.Plo │ │ ├── libtcmalloc_internal_la-sampler.Plo │ │ ├── libtcmalloc_internal_la-span.Plo │ │ ├── libtcmalloc_internal_la-stack_trace_table.Plo │ │ ├── libtcmalloc_internal_la-static_vars.Plo │ │ ├── libtcmalloc_internal_la-symbolize.Plo │ │ ├── libtcmalloc_internal_la-system-alloc.Plo │ │ ├── libtcmalloc_internal_la-thread_cache.Plo │ │ ├── libtcmalloc_la-heap-checker-bcad.Plo │ │ ├── libtcmalloc_la-heap-checker.Plo │ │ ├── libtcmalloc_la-linuxthreads.Plo │ │ ├── libtcmalloc_la-tcmalloc.Plo │ │ ├── libtcmalloc_minimal_debug_la-debugallocation.Plo │ │ ├── libtcmalloc_minimal_internal_la-central_freelist.Plo │ │ ├── libtcmalloc_minimal_internal_la-common.Plo │ │ ├── libtcmalloc_minimal_internal_la-internal_logging.Plo │ │ ├── libtcmalloc_minimal_internal_la-malloc_extension.Plo │ │ ├── libtcmalloc_minimal_internal_la-malloc_hook.Plo │ │ ├── libtcmalloc_minimal_internal_la-maybe_threads.Plo │ │ ├── libtcmalloc_minimal_internal_la-memfs_malloc.Plo │ │ ├── libtcmalloc_minimal_internal_la-page_heap.Plo │ │ ├── libtcmalloc_minimal_internal_la-sampler.Plo │ │ ├── libtcmalloc_minimal_internal_la-span.Plo │ │ ├── libtcmalloc_minimal_internal_la-stack_trace_table.Plo │ │ ├── libtcmalloc_minimal_internal_la-static_vars.Plo │ │ ├── libtcmalloc_minimal_internal_la-symbolize.Plo │ │ ├── libtcmalloc_minimal_internal_la-system-alloc.Plo │ │ ├── libtcmalloc_minimal_internal_la-thread_cache.Plo │ │ ├── libtcmalloc_minimal_la-tcmalloc.Plo │ │ ├── logging.Plo │ │ ├── low_level_alloc_unittest-low_level_alloc.Po │ │ ├── low_level_alloc_unittest-low_level_alloc_unittest.Po │ │ ├── low_level_alloc_unittest-malloc_hook.Po │ │ ├── low_level_alloc_unittest-maybe_threads.Po │ │ ├── malloc_extension_c_test-malloc_extension_c_test.Po │ │ ├── malloc_extension_debug_test-malloc_extension_test.Po │ │ ├── malloc_extension_test-malloc_extension_test.Po │ │ ├── malloc_hook_test-malloc_hook_test.Po │ │ ├── malloc_hook_test-testutil.Po │ │ ├── markidle_unittest-markidle_unittest.Po │ │ ├── markidle_unittest-testutil.Po │ │ ├── memalign_debug_unittest-memalign_unittest.Po │ │ ├── memalign_debug_unittest-testutil.Po │ │ ├── memalign_unittest-memalign_unittest.Po │ │ ├── memalign_unittest-testutil.Po │ │ ├── mini_disassembler.Plo │ │ ├── packed_cache_test-packed-cache_test.Po │ │ ├── page_heap_test-page_heap_test.Po │ │ ├── pagemap_unittest-pagemap_unittest.Po │ │ ├── patch_functions.Plo │ │ ├── port.Plo │ │ ├── preamble_patcher.Plo │ │ ├── preamble_patcher_with_stub.Plo │ │ ├── profile-handler.Plo │ │ ├── profile_handler_unittest-profile-handler_unittest.Po │ │ ├── profiledata.Plo │ │ ├── profiledata_unittest.Po │ │ ├── profiler.Plo │ │ ├── profiler1_unittest-profiler_unittest.Po │ │ ├── profiler1_unittest-testutil.Po │ │ ├── profiler2_unittest-profiler_unittest.Po │ │ ├── profiler2_unittest-testutil.Po │ │ ├── profiler3_unittest-profiler_unittest.Po │ │ ├── profiler3_unittest-testutil.Po │ │ ├── profiler4_unittest-profiler_unittest.Po │ │ ├── profiler4_unittest-testutil.Po │ │ ├── raw_printer_test-raw_printer_test.Po │ │ ├── realloc_debug_unittest-realloc_unittest.Po │ │ ├── realloc_unittest-realloc_unittest.Po │ │ ├── sampler_debug_test-sampler_test.Po │ │ ├── sampler_test-sampler_test.Po │ │ ├── sampling_debug_test-sampling_test.Po │ │ ├── sampling_test-sampling_test.Po │ │ ├── simple_compat_test.Po │ │ ├── spinlock.Plo │ │ ├── spinlock_internal.Plo │ │ ├── stack_trace_table_test-stack_trace_table_test.Po │ │ ├── stacktrace.Plo │ │ ├── stacktrace_unittest.Po │ │ ├── sysinfo.Plo │ │ ├── system_alloc_unittest-system-alloc_unittest.Po │ │ ├── tcmalloc_and_profiler_unittest-tcmalloc_unittest.Po │ │ ├── tcmalloc_and_profiler_unittest-testutil.Po │ │ ├── tcmalloc_both_unittest-tcmalloc_unittest.Po │ │ ├── tcmalloc_both_unittest-testutil.Po │ │ ├── tcmalloc_debug_unittest-tcmalloc_unittest.Po │ │ ├── tcmalloc_debug_unittest-testutil.Po │ │ ├── tcmalloc_large_unittest-tcmalloc_large_unittest.Po │ │ ├── tcmalloc_minimal_debug_unittest-tcmalloc_unittest.Po │ │ ├── tcmalloc_minimal_debug_unittest-testutil.Po │ │ ├── tcmalloc_minimal_large_unittest-tcmalloc_large_unittest.Po │ │ ├── tcmalloc_minimal_unittest-tcmalloc_unittest.Po │ │ ├── tcmalloc_minimal_unittest-testutil.Po │ │ ├── tcmalloc_unittest-tcmalloc_unittest.Po │ │ ├── tcmalloc_unittest-testutil.Po │ │ ├── thread_dealloc_unittest-testutil.Po │ │ ├── thread_dealloc_unittest-thread_dealloc_unittest.Po │ │ ├── thread_lister.Plo │ │ └── vdso_support.Plo │ ├── AUTHORS │ ├── COPYING │ ├── ChangeLog │ ├── INSTALL │ ├── Makefile │ ├── Makefile.am │ ├── Makefile.in │ ├── NEWS │ ├── README │ ├── README_windows.txt │ ├── TODO │ ├── aclocal.m4 │ ├── autom4te.cache │ │ ├── output.0 │ │ ├── requests │ │ └── traces.0 │ ├── compile │ ├── config.guess │ ├── config.log │ ├── config.status │ ├── config.sub │ ├── configure │ ├── configure.ac │ ├── depcomp │ ├── doc │ │ ├── cpuprofile-fileformat.html │ │ ├── cpuprofile.html │ │ ├── designstyle.css │ │ ├── heap-example1.png │ │ ├── heap_checker.html │ │ ├── heapprofile.html │ │ ├── index.html │ │ ├── overview.dot │ │ ├── overview.gif │ │ ├── pageheap.dot │ │ ├── pageheap.gif │ │ ├── pprof-test-big.gif │ │ ├── pprof-test.gif │ │ ├── pprof-vsnprintf-big.gif │ │ ├── pprof-vsnprintf.gif │ │ ├── pprof.1 │ │ ├── pprof_remote_servers.html │ │ ├── spanmap.dot │ │ ├── spanmap.gif │ │ ├── t-test1.times.txt │ │ ├── tcmalloc-opspercpusec.vs.threads.1024.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.128.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.131072.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.16384.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.2048.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.256.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.32768.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.4096.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.512.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.64.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.65536.bytes.png │ │ ├── tcmalloc-opspercpusec.vs.threads.8192.bytes.png │ │ ├── tcmalloc-opspersec.vs.size.1.threads.png │ │ ├── tcmalloc-opspersec.vs.size.12.threads.png │ │ ├── tcmalloc-opspersec.vs.size.16.threads.png │ │ ├── tcmalloc-opspersec.vs.size.2.threads.png │ │ ├── tcmalloc-opspersec.vs.size.20.threads.png │ │ ├── tcmalloc-opspersec.vs.size.3.threads.png │ │ ├── tcmalloc-opspersec.vs.size.4.threads.png │ │ ├── tcmalloc-opspersec.vs.size.5.threads.png │ │ ├── tcmalloc-opspersec.vs.size.8.threads.png │ │ ├── tcmalloc.html │ │ ├── threadheap.dot │ │ └── threadheap.gif │ ├── gperftools.sln │ ├── install-sh │ ├── libtool │ ├── ltmain.sh │ ├── m4 │ │ ├── ac_have_attribute.m4 │ │ ├── acx_nanosleep.m4 │ │ ├── acx_pthread.m4 │ │ ├── compiler_characteristics.m4 │ │ ├── install_prefix.m4 │ │ ├── libtool.m4 │ │ ├── ltoptions.m4 │ │ ├── ltsugar.m4 │ │ ├── ltversion.m4 │ │ ├── lt~obsolete.m4 │ │ ├── namespaces.m4 │ │ ├── pc_from_ucontext.m4 │ │ ├── program_invocation_name.m4 │ │ └── stl_namespace.m4 │ ├── missing │ ├── mkinstalldirs │ ├── packages │ │ ├── deb.sh │ │ ├── deb │ │ │ ├── README │ │ │ ├── changelog │ │ │ ├── compat │ │ │ ├── control │ │ │ ├── copyright │ │ │ ├── docs │ │ │ ├── libgperftools-dev.dirs │ │ │ ├── libgperftools-dev.install │ │ │ ├── libgperftools0.dirs │ │ │ ├── libgperftools0.install │ │ │ ├── libgperftools0.manpages │ │ │ └── rules │ │ ├── rpm.sh │ │ └── rpm │ │ │ └── rpm.spec │ ├── src │ │ ├── addressmap-inl.h │ │ ├── base │ │ │ ├── arm_instruction_set_select.h │ │ │ ├── atomicops-internals-arm-generic.h │ │ │ ├── atomicops-internals-arm-v6plus.h │ │ │ ├── atomicops-internals-linuxppc.h │ │ │ ├── atomicops-internals-macosx.h │ │ │ ├── atomicops-internals-windows.h │ │ │ ├── atomicops-internals-x86.cc │ │ │ ├── atomicops-internals-x86.h │ │ │ ├── atomicops.h │ │ │ ├── basictypes.h │ │ │ ├── commandlineflags.h │ │ │ ├── cycleclock.h │ │ │ ├── dynamic_annotations.c │ │ │ ├── dynamic_annotations.h │ │ │ ├── elf_mem_image.cc │ │ │ ├── elf_mem_image.h │ │ │ ├── elfcore.h │ │ │ ├── googleinit.h │ │ │ ├── linux_syscall_support.h │ │ │ ├── linuxthreads.cc │ │ │ ├── linuxthreads.h │ │ │ ├── logging.cc │ │ │ ├── logging.h │ │ │ ├── low_level_alloc.cc │ │ │ ├── low_level_alloc.h │ │ │ ├── simple_mutex.h │ │ │ ├── spinlock.cc │ │ │ ├── spinlock.h │ │ │ ├── spinlock_internal.cc │ │ │ ├── spinlock_internal.h │ │ │ ├── spinlock_linux-inl.h │ │ │ ├── spinlock_posix-inl.h │ │ │ ├── spinlock_win32-inl.h │ │ │ ├── stl_allocator.h │ │ │ ├── synchronization_profiling.h │ │ │ ├── sysinfo.cc │ │ │ ├── sysinfo.h │ │ │ ├── thread_annotations.h │ │ │ ├── thread_lister.c │ │ │ ├── thread_lister.h │ │ │ ├── vdso_support.cc │ │ │ └── vdso_support.h │ │ ├── central_freelist.cc │ │ ├── central_freelist.h │ │ ├── common.cc │ │ ├── common.h │ │ ├── config.h │ │ ├── config.h.in │ │ ├── config.h.in~ │ │ ├── config_for_unittests.h │ │ ├── debugallocation.cc │ │ ├── getpc.h │ │ ├── google │ │ │ ├── heap-checker.h │ │ │ ├── heap-profiler.h │ │ │ ├── malloc_extension.h │ │ │ ├── malloc_extension_c.h │ │ │ ├── malloc_hook.h │ │ │ ├── malloc_hook_c.h │ │ │ ├── profiler.h │ │ │ ├── stacktrace.h │ │ │ └── tcmalloc.h │ │ ├── gperftools │ │ │ ├── heap-checker.h │ │ │ ├── heap-profiler.h │ │ │ ├── malloc_extension.h │ │ │ ├── malloc_extension_c.h │ │ │ ├── malloc_hook.h │ │ │ ├── malloc_hook_c.h │ │ │ ├── profiler.h │ │ │ ├── stacktrace.h │ │ │ ├── tcmalloc.h │ │ │ └── tcmalloc.h.in │ │ ├── heap-checker-bcad.cc │ │ ├── heap-checker.cc │ │ ├── heap-profile-table.cc │ │ ├── heap-profile-table.h │ │ ├── heap-profiler.cc │ │ ├── internal_logging.cc │ │ ├── internal_logging.h │ │ ├── libc_override.h │ │ ├── libc_override_gcc_and_weak.h │ │ ├── libc_override_glibc.h │ │ ├── libc_override_osx.h │ │ ├── libc_override_redefine.h │ │ ├── linked_list.h │ │ ├── malloc_extension.cc │ │ ├── malloc_hook-inl.h │ │ ├── malloc_hook.cc │ │ ├── malloc_hook_mmap_freebsd.h │ │ ├── malloc_hook_mmap_linux.h │ │ ├── maybe_threads.cc │ │ ├── maybe_threads.h │ │ ├── memfs_malloc.cc │ │ ├── memory_region_map.cc │ │ ├── memory_region_map.h │ │ ├── packed-cache-inl.h │ │ ├── page_heap.cc │ │ ├── page_heap.h │ │ ├── page_heap_allocator.h │ │ ├── pagemap.h │ │ ├── pprof │ │ ├── profile-handler.cc │ │ ├── profile-handler.h │ │ ├── profiledata.cc │ │ ├── profiledata.h │ │ ├── profiler.cc │ │ ├── raw_printer.cc │ │ ├── raw_printer.h │ │ ├── sampler.cc │ │ ├── sampler.h │ │ ├── solaris │ │ │ └── libstdc++.la │ │ ├── span.cc │ │ ├── span.h │ │ ├── stack_trace_table.cc │ │ ├── stack_trace_table.h │ │ ├── stacktrace.cc │ │ ├── stacktrace_arm-inl.h │ │ ├── stacktrace_config.h │ │ ├── stacktrace_generic-inl.h │ │ ├── stacktrace_libunwind-inl.h │ │ ├── stacktrace_powerpc-inl.h │ │ ├── stacktrace_win32-inl.h │ │ ├── stacktrace_x86-inl.h │ │ ├── stamp-h1 │ │ ├── static_vars.cc │ │ ├── static_vars.h │ │ ├── symbolize.cc │ │ ├── symbolize.h │ │ ├── system-alloc.cc │ │ ├── system-alloc.h │ │ ├── tcmalloc.cc │ │ ├── tcmalloc.h │ │ ├── tcmalloc_guard.h │ │ ├── tests │ │ │ ├── addressmap_unittest.cc │ │ │ ├── atomicops_unittest.cc │ │ │ ├── current_allocated_bytes_test.cc │ │ │ ├── debugallocation_test.cc │ │ │ ├── debugallocation_test.sh │ │ │ ├── frag_unittest.cc │ │ │ ├── getpc_test.cc │ │ │ ├── heap-checker-death_unittest.sh │ │ │ ├── heap-checker_unittest.cc │ │ │ ├── heap-checker_unittest.sh │ │ │ ├── heap-profiler_unittest.cc │ │ │ ├── heap-profiler_unittest.sh │ │ │ ├── low_level_alloc_unittest.cc │ │ │ ├── malloc_extension_c_test.c │ │ │ ├── malloc_extension_test.cc │ │ │ ├── malloc_hook_test.cc │ │ │ ├── markidle_unittest.cc │ │ │ ├── maybe_threads_unittest.sh │ │ │ ├── memalign_unittest.cc │ │ │ ├── packed-cache_test.cc │ │ │ ├── page_heap_test.cc │ │ │ ├── pagemap_unittest.cc │ │ │ ├── profile-handler_unittest.cc │ │ │ ├── profiledata_unittest.cc │ │ │ ├── profiler_unittest.cc │ │ │ ├── profiler_unittest.sh │ │ │ ├── raw_printer_test.cc │ │ │ ├── realloc_unittest.cc │ │ │ ├── sampler_test.cc │ │ │ ├── sampling_test.cc │ │ │ ├── sampling_test.sh │ │ │ ├── simple_compat_test.cc │ │ │ ├── stack_trace_table_test.cc │ │ │ ├── stacktrace_unittest.cc │ │ │ ├── system-alloc_unittest.cc │ │ │ ├── tcmalloc_large_unittest.cc │ │ │ ├── tcmalloc_unittest.cc │ │ │ ├── testutil.cc │ │ │ ├── testutil.h │ │ │ └── thread_dealloc_unittest.cc │ │ ├── third_party │ │ │ └── valgrind.h │ │ ├── thread_cache.cc │ │ ├── thread_cache.h │ │ └── windows │ │ │ ├── addr2line-pdb.c │ │ │ ├── auto_testing_hook.h │ │ │ ├── config.h │ │ │ ├── get_mangled_names.cc │ │ │ ├── google │ │ │ └── tcmalloc.h │ │ │ ├── gperftools │ │ │ ├── tcmalloc.h │ │ │ └── tcmalloc.h.in │ │ │ ├── ia32_modrm_map.cc │ │ │ ├── ia32_opcode_map.cc │ │ │ ├── mingw.h │ │ │ ├── mini_disassembler.cc │ │ │ ├── mini_disassembler.h │ │ │ ├── mini_disassembler_types.h │ │ │ ├── nm-pdb.c │ │ │ ├── override_functions.cc │ │ │ ├── patch_functions.cc │ │ │ ├── port.cc │ │ │ ├── port.h │ │ │ ├── preamble_patcher.cc │ │ │ ├── preamble_patcher.h │ │ │ ├── preamble_patcher_test.cc │ │ │ ├── preamble_patcher_with_stub.cc │ │ │ └── shortproc.asm │ └── vsprojects │ │ ├── addr2line-pdb │ │ └── addr2line-pdb.vcproj │ │ ├── addressmap_unittest │ │ └── addressmap_unittest.vcproj │ │ ├── current_allocated_bytes_test │ │ └── current_allocated_bytes_test.vcproj │ │ ├── frag_unittest │ │ └── frag_unittest.vcproj │ │ ├── libtcmalloc_minimal │ │ └── libtcmalloc_minimal.vcproj │ │ ├── low_level_alloc_unittest │ │ └── low_level_alloc_unittest.vcproj │ │ ├── malloc_extension_test │ │ └── malloc_extension_test.vcproj │ │ ├── malloc_hook_test │ │ └── malloc_hook_test.vcproj │ │ ├── markidle_unittest │ │ └── markidle_unittest.vcproj │ │ ├── nm-pdb │ │ └── nm-pdb.vcproj │ │ ├── packed-cache_test │ │ └── packed-cache_test.vcproj │ │ ├── page_heap_test │ │ └── page_heap_test.vcproj │ │ ├── pagemap_unittest │ │ └── pagemap_unittest.vcproj │ │ ├── preamble_patcher_test │ │ └── preamble_patcher_test.vcproj │ │ ├── realloc_unittest │ │ └── realloc_unittest.vcproj │ │ ├── sampler_test │ │ └── sampler_test.vcproj │ │ ├── stack_trace_table_test │ │ └── stack_trace_table_test.vcproj │ │ ├── tcmalloc_minimal_large │ │ └── tcmalloc_minimal_large_unittest.vcproj │ │ ├── tcmalloc_minimal_unittest │ │ └── tcmalloc_minimal_unittest.vcproj │ │ ├── thread_dealloc_unittest │ │ └── thread_dealloc_unittest.vcproj │ │ └── tmu-static │ │ └── tmu-static.vcproj ├── hiredis │ ├── .gitignore │ ├── CHANGELOG.md │ ├── COPYING │ ├── Makefile │ ├── README.md │ ├── adapters │ │ ├── ae.h │ │ ├── libev.h │ │ └── libevent.h │ ├── async.c │ ├── async.h │ ├── dict.c │ ├── dict.h │ ├── example-ae.c │ ├── example-libev.c │ ├── example-libevent.c │ ├── example.c │ ├── fmacros.h │ ├── hiredis.c │ ├── hiredis.h │ ├── net.c │ ├── net.h │ ├── sds.c │ ├── sds.h │ └── test.c ├── jemalloc │ ├── .gitignore │ ├── COPYING │ ├── ChangeLog │ ├── INSTALL │ ├── Makefile.in │ ├── README │ ├── VERSION │ ├── autogen.sh │ ├── bin │ │ ├── jemalloc.sh.in │ │ └── pprof │ ├── config.guess │ ├── config.stamp.in │ ├── config.sub │ ├── configure │ ├── configure.ac │ ├── doc │ │ ├── html.xsl.in │ │ ├── jemalloc.3 │ │ ├── jemalloc.html │ │ ├── jemalloc.xml.in │ │ ├── manpages.xsl.in │ │ └── stylesheet.xsl │ ├── include │ │ ├── jemalloc │ │ │ ├── internal │ │ │ │ ├── arena.h │ │ │ │ ├── atomic.h │ │ │ │ ├── base.h │ │ │ │ ├── bitmap.h │ │ │ │ ├── chunk.h │ │ │ │ ├── chunk_dss.h │ │ │ │ ├── chunk_mmap.h │ │ │ │ ├── ckh.h │ │ │ │ ├── ctl.h │ │ │ │ ├── extent.h │ │ │ │ ├── hash.h │ │ │ │ ├── huge.h │ │ │ │ ├── jemalloc_internal.h.in │ │ │ │ ├── mb.h │ │ │ │ ├── mutex.h │ │ │ │ ├── private_namespace.h │ │ │ │ ├── prng.h │ │ │ │ ├── prof.h │ │ │ │ ├── ql.h │ │ │ │ ├── qr.h │ │ │ │ ├── quarantine.h │ │ │ │ ├── rb.h │ │ │ │ ├── rtree.h │ │ │ │ ├── size_classes.sh │ │ │ │ ├── stats.h │ │ │ │ ├── tcache.h │ │ │ │ ├── tsd.h │ │ │ │ └── util.h │ │ │ ├── jemalloc.h.in │ │ │ └── jemalloc_defs.h.in │ │ └── msvc_compat │ │ │ ├── inttypes.h │ │ │ ├── stdbool.h │ │ │ ├── stdint.h │ │ │ └── strings.h │ ├── install-sh │ ├── src │ │ ├── arena.c │ │ ├── atomic.c │ │ ├── base.c │ │ ├── bitmap.c │ │ ├── chunk.c │ │ ├── chunk_dss.c │ │ ├── chunk_mmap.c │ │ ├── ckh.c │ │ ├── ctl.c │ │ ├── extent.c │ │ ├── hash.c │ │ ├── huge.c │ │ ├── jemalloc.c │ │ ├── mb.c │ │ ├── mutex.c │ │ ├── prof.c │ │ ├── quarantine.c │ │ ├── rtree.c │ │ ├── stats.c │ │ ├── tcache.c │ │ ├── tsd.c │ │ ├── util.c │ │ └── zone.c │ └── test │ │ ├── ALLOCM_ARENA.c │ │ ├── ALLOCM_ARENA.exp │ │ ├── aligned_alloc.c │ │ ├── aligned_alloc.exp │ │ ├── allocated.c │ │ ├── allocated.exp │ │ ├── allocm.c │ │ ├── allocm.exp │ │ ├── bitmap.c │ │ ├── bitmap.exp │ │ ├── mremap.c │ │ ├── mremap.exp │ │ ├── posix_memalign.c │ │ ├── posix_memalign.exp │ │ ├── rallocm.c │ │ ├── rallocm.exp │ │ ├── thread_arena.c │ │ ├── thread_arena.exp │ │ ├── thread_tcache_enabled.c │ │ └── thread_tcache_enabled.exp ├── leveldb-1.10.0 │ ├── .gitignore │ ├── AUTHORS │ ├── LICENSE │ ├── Makefile │ ├── NEWS │ ├── README │ ├── TODO │ ├── build_detect_platform │ ├── db │ │ ├── builder.cc │ │ ├── builder.h │ │ ├── c.cc │ │ ├── c_test.c │ │ ├── corruption_test.cc │ │ ├── db_bench.cc │ │ ├── db_impl.cc │ │ ├── db_impl.h │ │ ├── db_iter.cc │ │ ├── db_iter.h │ │ ├── db_test.cc │ │ ├── dbformat.cc │ │ ├── dbformat.h │ │ ├── dbformat_test.cc │ │ ├── filename.cc │ │ ├── filename.h │ │ ├── filename_test.cc │ │ ├── leveldb_main.cc │ │ ├── log_format.h │ │ ├── log_reader.cc │ │ ├── log_reader.h │ │ ├── log_test.cc │ │ ├── log_writer.cc │ │ ├── log_writer.h │ │ ├── memtable.cc │ │ ├── memtable.h │ │ ├── repair.cc │ │ ├── skiplist.h │ │ ├── skiplist_test.cc │ │ ├── snapshot.h │ │ ├── table_cache.cc │ │ ├── table_cache.h │ │ ├── version_edit.cc │ │ ├── version_edit.h │ │ ├── version_edit_test.cc │ │ ├── version_set.cc │ │ ├── version_set.h │ │ ├── version_set_test.cc │ │ ├── write_batch.cc │ │ ├── write_batch_internal.h │ │ └── write_batch_test.cc │ ├── doc │ │ ├── bench │ │ │ ├── db_bench_sqlite3.cc │ │ │ └── db_bench_tree_db.cc │ │ ├── benchmark.html │ │ ├── doc.css │ │ ├── impl.html │ │ ├── index.html │ │ ├── log_format.txt │ │ └── table_format.txt │ ├── helpers │ │ └── memenv │ │ │ ├── memenv.cc │ │ │ ├── memenv.h │ │ │ └── memenv_test.cc │ ├── include │ │ └── leveldb │ │ │ ├── c.h │ │ │ ├── cache.h │ │ │ ├── comparator.h │ │ │ ├── db.h │ │ │ ├── env.h │ │ │ ├── filter_policy.h │ │ │ ├── iterator.h │ │ │ ├── options.h │ │ │ ├── slice.h │ │ │ ├── status.h │ │ │ ├── table.h │ │ │ ├── table_builder.h │ │ │ └── write_batch.h │ ├── leveldb-1.10.0.tar │ ├── port │ │ ├── README │ │ ├── atomic_pointer.h │ │ ├── port.h │ │ ├── port_example.h │ │ ├── port_posix.cc │ │ ├── port_posix.h │ │ ├── thread_annotations.h │ │ └── win │ │ │ └── stdint.h │ ├── table │ │ ├── block.cc │ │ ├── block.h │ │ ├── block_builder.cc │ │ ├── block_builder.h │ │ ├── filter_block.cc │ │ ├── filter_block.h │ │ ├── filter_block_test.cc │ │ ├── format.cc │ │ ├── format.h │ │ ├── iterator.cc │ │ ├── iterator_wrapper.h │ │ ├── merger.cc │ │ ├── merger.h │ │ ├── table.cc │ │ ├── table_builder.cc │ │ ├── table_test.cc │ │ ├── two_level_iterator.cc │ │ └── two_level_iterator.h │ └── util │ │ ├── arena.cc │ │ ├── arena.h │ │ ├── arena_test.cc │ │ ├── bloom.cc │ │ ├── bloom_test.cc │ │ ├── cache.cc │ │ ├── cache_test.cc │ │ ├── coding.cc │ │ ├── coding.h │ │ ├── coding_test.cc │ │ ├── comparator.cc │ │ ├── crc32c.cc │ │ ├── crc32c.h │ │ ├── crc32c_test.cc │ │ ├── env.cc │ │ ├── env_posix.cc │ │ ├── env_test.cc │ │ ├── filter_policy.cc │ │ ├── hash.cc │ │ ├── hash.h │ │ ├── histogram.cc │ │ ├── histogram.h │ │ ├── logging.cc │ │ ├── logging.h │ │ ├── mutexlock.h │ │ ├── options.cc │ │ ├── posix_logger.h │ │ ├── random.h │ │ ├── status.cc │ │ ├── testharness.cc │ │ ├── testharness.h │ │ ├── testutil.cc │ │ └── testutil.h ├── linenoise │ ├── .gitignore │ ├── Makefile │ ├── README.markdown │ ├── example.c │ ├── linenoise.c │ └── linenoise.h ├── lua │ ├── COPYRIGHT │ ├── Makefile │ ├── README │ ├── doc │ │ ├── bluequad-print.css │ │ ├── bluequad.css │ │ ├── changes.html │ │ ├── contact.html │ │ ├── ext_c_api.html │ │ ├── ext_ffi.html │ │ ├── ext_ffi_api.html │ │ ├── ext_ffi_semantics.html │ │ ├── ext_ffi_tutorial.html │ │ ├── ext_jit.html │ │ ├── extensions.html │ │ ├── faq.html │ │ ├── img │ │ │ └── contact.png │ │ ├── install.html │ │ ├── luajit.html │ │ ├── running.html │ │ └── status.html │ ├── dynasm │ │ ├── dasm_arm.h │ │ ├── dasm_arm.lua │ │ ├── dasm_mips.h │ │ ├── dasm_mips.lua │ │ ├── dasm_ppc.h │ │ ├── dasm_ppc.lua │ │ ├── dasm_proto.h │ │ ├── dasm_x64.lua │ │ ├── dasm_x86.h │ │ ├── dasm_x86.lua │ │ └── dynasm.lua │ ├── etc │ │ ├── luajit.1 │ │ └── luajit.pc │ └── src │ │ ├── Makefile │ │ ├── Makefile.dep │ │ ├── host │ │ ├── README │ │ ├── buildvm.c │ │ ├── buildvm.h │ │ ├── buildvm_asm.c │ │ ├── buildvm_fold.c │ │ ├── buildvm_lib.c │ │ ├── buildvm_peobj.c │ │ ├── genminilua.lua │ │ └── minilua.c │ │ ├── jit │ │ ├── bc.lua │ │ ├── bcsave.lua │ │ ├── dis_arm.lua │ │ ├── dis_mips.lua │ │ ├── dis_mipsel.lua │ │ ├── dis_ppc.lua │ │ ├── dis_x64.lua │ │ ├── dis_x86.lua │ │ ├── dump.lua │ │ └── v.lua │ │ ├── lauxlib.h │ │ ├── lib_aux.c │ │ ├── lib_base.c │ │ ├── lib_bit.c │ │ ├── lib_debug.c │ │ ├── lib_ffi.c │ │ ├── lib_init.c │ │ ├── lib_io.c │ │ ├── lib_jit.c │ │ ├── lib_math.c │ │ ├── lib_os.c │ │ ├── lib_package.c │ │ ├── lib_string.c │ │ ├── lib_table.c │ │ ├── lj.supp │ │ ├── lj_alloc.c │ │ ├── lj_alloc.h │ │ ├── lj_api.c │ │ ├── lj_arch.h │ │ ├── lj_asm.c │ │ ├── lj_asm.h │ │ ├── lj_asm_arm.h │ │ ├── lj_asm_mips.h │ │ ├── lj_asm_ppc.h │ │ ├── lj_asm_x86.h │ │ ├── lj_bc.c │ │ ├── lj_bc.h │ │ ├── lj_bcdump.h │ │ ├── lj_bcread.c │ │ ├── lj_bcwrite.c │ │ ├── lj_carith.c │ │ ├── lj_carith.h │ │ ├── lj_ccall.c │ │ ├── lj_ccall.h │ │ ├── lj_ccallback.c │ │ ├── lj_ccallback.h │ │ ├── lj_cconv.c │ │ ├── lj_cconv.h │ │ ├── lj_cdata.c │ │ ├── lj_cdata.h │ │ ├── lj_char.c │ │ ├── lj_char.h │ │ ├── lj_clib.c │ │ ├── lj_clib.h │ │ ├── lj_cparse.c │ │ ├── lj_cparse.h │ │ ├── lj_crecord.c │ │ ├── lj_crecord.h │ │ ├── lj_ctype.c │ │ ├── lj_ctype.h │ │ ├── lj_debug.c │ │ ├── lj_debug.h │ │ ├── lj_def.h │ │ ├── lj_dispatch.c │ │ ├── lj_dispatch.h │ │ ├── lj_emit_arm.h │ │ ├── lj_emit_mips.h │ │ ├── lj_emit_ppc.h │ │ ├── lj_emit_x86.h │ │ ├── lj_err.c │ │ ├── lj_err.h │ │ ├── lj_errmsg.h │ │ ├── lj_ff.h │ │ ├── lj_ffrecord.c │ │ ├── lj_ffrecord.h │ │ ├── lj_frame.h │ │ ├── lj_func.c │ │ ├── lj_func.h │ │ ├── lj_gc.c │ │ ├── lj_gc.h │ │ ├── lj_gdbjit.c │ │ ├── lj_gdbjit.h │ │ ├── lj_ir.c │ │ ├── lj_ir.h │ │ ├── lj_ircall.h │ │ ├── lj_iropt.h │ │ ├── lj_jit.h │ │ ├── lj_lex.c │ │ ├── lj_lex.h │ │ ├── lj_lib.c │ │ ├── lj_lib.h │ │ ├── lj_load.c │ │ ├── lj_mcode.c │ │ ├── lj_mcode.h │ │ ├── lj_meta.c │ │ ├── lj_meta.h │ │ ├── lj_obj.c │ │ ├── lj_obj.h │ │ ├── lj_opt_dce.c │ │ ├── lj_opt_fold.c │ │ ├── lj_opt_loop.c │ │ ├── lj_opt_mem.c │ │ ├── lj_opt_narrow.c │ │ ├── lj_opt_sink.c │ │ ├── lj_opt_split.c │ │ ├── lj_parse.c │ │ ├── lj_parse.h │ │ ├── lj_record.c │ │ ├── lj_record.h │ │ ├── lj_snap.c │ │ ├── lj_snap.h │ │ ├── lj_state.c │ │ ├── lj_state.h │ │ ├── lj_str.c │ │ ├── lj_str.h │ │ ├── lj_strscan.c │ │ ├── lj_strscan.h │ │ ├── lj_tab.c │ │ ├── lj_tab.h │ │ ├── lj_target.h │ │ ├── lj_target_arm.h │ │ ├── lj_target_mips.h │ │ ├── lj_target_ppc.h │ │ ├── lj_target_x86.h │ │ ├── lj_trace.c │ │ ├── lj_trace.h │ │ ├── lj_traceerr.h │ │ ├── lj_udata.c │ │ ├── lj_udata.h │ │ ├── lj_vm.h │ │ ├── lj_vmevent.c │ │ ├── lj_vmevent.h │ │ ├── lj_vmmath.c │ │ ├── ljamalg.c │ │ ├── lua.h │ │ ├── lua.hpp │ │ ├── luaconf.h │ │ ├── luajit.c │ │ ├── luajit.h │ │ ├── lualib.h │ │ ├── msvcbuild.bat │ │ ├── vm_arm.dasc │ │ ├── vm_mips.dasc │ │ ├── vm_ppc.dasc │ │ ├── vm_ppcspe.dasc │ │ └── vm_x86.dasc └── snappy-1.1.0.tar.gz ├── php-hiredis ├── COPYING ├── README.md ├── TODO ├── config.m4 ├── php_phpiredis.h ├── php_phpiredis_struct.h ├── phpiredis.c ├── redis.php └── tests │ ├── 001.phpt │ ├── 002.phpt │ ├── 003.phpt │ ├── 004.phpt │ ├── 005.phpt │ ├── 006.phpt │ ├── 007.phpt │ ├── 008.phpt │ ├── 009.phpt │ ├── 010.phpt │ ├── 011.phpt │ ├── 012.phpt │ ├── 013.phpt │ ├── 014.phpt │ ├── 015.phpt │ ├── 016.phpt │ ├── 017.phpt │ ├── 018.phpt │ ├── 019.phpt │ ├── 020.phpt │ ├── 021.phpt │ ├── 022.phpt │ ├── 023.phpt │ ├── connect.inc │ └── skipif.inc ├── redis.conf ├── redis_storage.so.conf ├── runtest ├── sentinel.conf ├── src ├── .DS_Store ├── .gitignore ├── .make-prerequisites ├── .make-settings ├── Makefile ├── Makefile.dep ├── adlist.c ├── adlist.h ├── ae.c ├── ae.h ├── ae_epoll.c ├── ae_evport.c ├── ae_kqueue.c ├── ae_select.c ├── anet.c ├── anet.h ├── aof.c ├── asciilogo.h ├── bio.c ├── bio.h ├── bitops.c ├── config.c ├── config.h ├── crc64.c ├── db.c ├── debug.c ├── dict.c ├── dict.h ├── ds.c ├── endianconv.c ├── endianconv.h ├── fmacros.h ├── help.h ├── intset.c ├── intset.h ├── lua_cjson.c ├── lua_cmsgpack.c ├── lua_struct.c ├── lzf.h ├── lzfP.h ├── lzf_c.c ├── lzf_d.c ├── memtest.c ├── migrate.c ├── mkreleasehdr.sh ├── multi.c ├── networking.c ├── object.c ├── pqsort.c ├── pqsort.h ├── pubsub.c ├── rand.c ├── rand.h ├── rdb.c ├── rdb.h ├── redis-benchmark.c ├── redis-check-aof.c ├── redis-check-dump.c ├── redis-cli.c ├── redis.c ├── redis.h ├── release.c ├── release.h ├── replication.c ├── rio.c ├── rio.h ├── scripting.c ├── sds.c ├── sds.h ├── sentinel.c ├── sha1.c ├── sha1.h ├── slowlog.c ├── slowlog.h ├── solarisfixes.h ├── sort.c ├── strbuf.c ├── strbuf.h ├── syncio.c ├── t_hash.c ├── t_list.c ├── t_set.c ├── t_string.c ├── t_zset.c ├── testhelp.h ├── util.c ├── util.h ├── valgrind.sup ├── version.h ├── ziplist.c ├── ziplist.h ├── zipmap.c ├── zipmap.h ├── zmalloc.c └── zmalloc.h ├── tests ├── assets │ ├── default.conf │ ├── encodings.rdb │ └── hash-zipmap.rdb ├── helpers │ ├── bg_complex_data.tcl │ └── gen_write_load.tcl ├── integration │ ├── aof-race.tcl │ ├── aof.tcl │ ├── convert-zipmap-hash-on-load.tcl │ ├── rdb.tcl │ ├── redis-cli.tcl │ ├── replication-2.tcl │ ├── replication-3.tcl │ ├── replication-4.tcl │ └── replication.tcl ├── support │ ├── redis.tcl │ ├── server.tcl │ ├── test.tcl │ ├── tmpfile.tcl │ └── util.tcl ├── test_helper.tcl └── unit │ ├── aofrw.tcl │ ├── auth.tcl │ ├── basic.tcl │ ├── bitops.tcl │ ├── dump.tcl │ ├── expire.tcl │ ├── introspection.tcl │ ├── limits.tcl │ ├── maxmemory.tcl │ ├── multi.tcl │ ├── obuf-limits.tcl │ ├── other.tcl │ ├── printver.tcl │ ├── protocol.tcl │ ├── pubsub.tcl │ ├── quit.tcl │ ├── scripting.tcl │ ├── slowlog.tcl │ ├── sort.tcl │ └── type │ ├── hash.tcl │ ├── list-2.tcl │ ├── list-3.tcl │ ├── list-common.tcl │ ├── list.tcl │ ├── set.tcl │ └── zset.tcl └── utils ├── build-static-symbols.tcl ├── generate-command-help.rb ├── install_server.sh ├── mkrelease.sh ├── redis-copy.rb ├── redis-sha1.rb ├── redis_init_script ├── redis_init_script.tpl ├── speed-regression.tcl └── whatisdoing.sh /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/.DS_Store -------------------------------------------------------------------------------- /BUGS: -------------------------------------------------------------------------------- 1 | Plese check https://github.com/antirez/redis/issues 2 | -------------------------------------------------------------------------------- /CONTRIBUTING: -------------------------------------------------------------------------------- 1 | Note: by contributing code to the Redis project in any form, including sending 2 | a pull request via Github, a code fragment or patch via private email or 3 | public discussion groups, you agree to release your code under the terms 4 | of the BSD license that you can find in the COPYING file included in the Redis 5 | source distribution. You will include BSD license in the COPYING file within 6 | each source file that you contribute. 7 | 8 | # IMPORTANT: HOW TO USE REDIS GITHUB ISSUES 9 | 10 | * Github issues SHOULD ONLY BE USED to report bugs, and for DETAILED feature 11 | requests. Everything else belongs to the Redis Google Group. 12 | 13 | PLEASE DO NOT POST GENERAL QUESTIONS that are not about bugs or suspected 14 | bugs in the Github issues system. We'll be very happy to help you and provide 15 | all the support in the Redis Google Group. 16 | 17 | Redis Google Group address: 18 | 19 | https://groups.google.com/forum/?fromgroups#!forum/redis-db 20 | 21 | # How to provide a patch for a new feature 22 | 23 | 1. Drop a message to the Redis Google Group with a proposal of semantics/API. 24 | 25 | 2. If in steps 1 you get an acknowledge from the project leaders, use the 26 | following procedure to submit a patch: 27 | 28 | a. Fork Redis on github ( http://help.github.com/fork-a-repo/ ) 29 | b. Create a topic branch (git checkout -b my_branch) 30 | c. Push to your branch (git push origin my_branch) 31 | d. Initiate a pull request on github ( http://help.github.com/send-pull-requests/ ) 32 | e. Done :) 33 | 34 | Thanks! 35 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006-2012, Salvatore Sanfilippo 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * Neither the name of Redis nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | See README 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Top level makefile, the real shit is at src/Makefile 2 | 3 | default: all 4 | 5 | .DEFAULT: 6 | cd deps/lua && $(MAKE) $@ 7 | cd deps/hiredis && $(MAKE) $@ 8 | cd deps/linenoise && $(MAKE) 9 | cd src && $(MAKE) $@ 10 | 11 | init: 12 | cd deps/gperftools-2.0 && ./configure --enable-minimal --enable-frame-pointers && make 13 | cd deps && tar xzvf snappy-1.1.0.tar.gz && cd snappy-1.1.0 && ./configure && make 14 | rm -rf /usr/local/lib/libsnappy.so.1 15 | cp ./deps/snappy-1.1.0/.libs/libsnappy.so.1 /usr/local/lib 16 | ldconfig 17 | chmod +x deps/leveldb-1.10.0/build_detect_platform 18 | cd deps/leveldb-1.10.0 && make 19 | rm -rf /usr/local/lib/libleveldb.so.1 20 | cp ./deps/leveldb-1.10.0/libleveldb.so.1 /usr/local/lib 21 | cp ./redis_storage.so.conf /etc/ld.so.conf.d/redis_storage.conf 22 | ldconfig 23 | 24 | install: 25 | mkdir -p $(PREFIX)/db 26 | mkdir -p $(PREFIX)/bin 27 | mkdir -p $(PREFIX)/log 28 | mkdir -p $(PREFIX)/conf 29 | cp src/redis-server $(PREFIX)/bin 30 | cp src/redis-cli $(PREFIX)/bin 31 | cp src/redis-check-dump $(PREFIX)/bin 32 | cp src/redis-sentinel $(PREFIX)/bin 33 | cp src/redis-benchmark $(PREFIX)/bin 34 | cp src/redis-check-aof $(PREFIX)/bin 35 | cp redis.conf $(PREFIX)/conf 36 | 37 | 38 | .PHONY: install 39 | -------------------------------------------------------------------------------- /deps/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/.DS_Store -------------------------------------------------------------------------------- /deps/.make-cflags: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /deps/.make-ldflags: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /deps/.make-prerequisites: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/.make-prerequisites -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/addressmap_unittest-port.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/debugallocation_test-debugallocation_test.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/elf_mem_image.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/getpc_test.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/heap_checker_debug_unittest-heap-checker_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/heap_checker_unittest-heap-checker_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/heap_profiler_debug_unittest-heap-profiler_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/heap_profiler_unittest-heap-profiler_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/ia32_modrm_map.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/ia32_opcode_map.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_and_profiler_la-heap-checker-bcad.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_and_profiler_la-heap-checker.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_and_profiler_la-linuxthreads.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_and_profiler_la-profile-handler.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_and_profiler_la-profiledata.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_and_profiler_la-profiler.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_and_profiler_la-tcmalloc.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_debug_la-debugallocation.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_debug_la-heap-checker-bcad.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_debug_la-heap-checker.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_debug_la-linuxthreads.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-central_freelist.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-common.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-heap-profile-table.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-heap-profiler.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-internal_logging.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-low_level_alloc.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-malloc_extension.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-malloc_hook.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-maybe_threads.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-memfs_malloc.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-memory_region_map.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-page_heap.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-raw_printer.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-sampler.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-span.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-stack_trace_table.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-static_vars.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-symbolize.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-system-alloc.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_internal_la-thread_cache.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_la-heap-checker-bcad.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_la-heap-checker.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_la-linuxthreads.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_la-tcmalloc.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/libtcmalloc_minimal_internal_la-common.Plo: -------------------------------------------------------------------------------- 1 | libtcmalloc_minimal_internal_la-common.lo: src/common.cc src/config.h \ 2 | src/common.h /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \ 3 | /usr/include/stdint.h /usr/include/features.h /usr/include/sys/cdefs.h \ 4 | /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ 5 | /usr/include/gnu/stubs-64.h /usr/include/bits/wchar.h \ 6 | src/internal_logging.h src/config.h src/system-alloc.h 7 | 8 | src/config.h: 9 | 10 | src/common.h: 11 | 12 | /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h: 13 | 14 | /usr/include/stdint.h: 15 | 16 | /usr/include/features.h: 17 | 18 | /usr/include/sys/cdefs.h: 19 | 20 | /usr/include/bits/wordsize.h: 21 | 22 | /usr/include/gnu/stubs.h: 23 | 24 | /usr/include/gnu/stubs-64.h: 25 | 26 | /usr/include/bits/wchar.h: 27 | 28 | src/internal_logging.h: 29 | 30 | src/config.h: 31 | 32 | src/system-alloc.h: 33 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/malloc_extension_c_test-malloc_extension_c_test.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/mini_disassembler.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/patch_functions.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/port.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/preamble_patcher.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/preamble_patcher_with_stub.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profile-handler.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profile_handler_unittest-profile-handler_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiledata.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiledata_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiler.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiler1_unittest-profiler_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiler1_unittest-testutil.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiler2_unittest-profiler_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiler2_unittest-testutil.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiler3_unittest-profiler_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiler3_unittest-testutil.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiler4_unittest-profiler_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/profiler4_unittest-testutil.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/raw_printer_test-raw_printer_test.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/sampler_debug_test-sampler_test.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/sampler_test-sampler_test.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/sampling_debug_test-sampling_test.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/sampling_test-sampling_test.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/simple_compat_test.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/stacktrace.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/stacktrace_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/tcmalloc_and_profiler_unittest-tcmalloc_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/tcmalloc_and_profiler_unittest-testutil.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/tcmalloc_both_unittest-tcmalloc_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/tcmalloc_both_unittest-testutil.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/tcmalloc_debug_unittest-tcmalloc_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/tcmalloc_debug_unittest-testutil.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/tcmalloc_large_unittest-tcmalloc_large_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/tcmalloc_unittest-tcmalloc_unittest.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/tcmalloc_unittest-testutil.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/thread_lister.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/.deps/vdso_support.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/AUTHORS: -------------------------------------------------------------------------------- 1 | google-perftools@googlegroups.com 2 | 3 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2005, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/heap-example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/heap-example1.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gperftools 5 | 6 | 7 | 8 | 14 | 15 |
16 | Last modified: Thu Feb 2 14:40:47 PST 2012 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/overview.dot: -------------------------------------------------------------------------------- 1 | digraph Overview { 2 | node [shape = box] 3 | 4 | {rank=same 5 | T1 [label="Thread Cache"] 6 | Tsep [label="...", shape=plaintext] 7 | Tn [label="Thread Cache"] 8 | T1 -> Tsep -> Tn [style=invis] 9 | } 10 | 11 | C [label="Central\nHeap"] 12 | T1 -> C [dir=both] 13 | Tn -> C [dir=both] 14 | 15 | } 16 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/overview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/overview.gif -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/pageheap.dot: -------------------------------------------------------------------------------- 1 | digraph PageHeap { 2 | rankdir=LR 3 | node [shape=box, width=0.3, height=0.3] 4 | nodesep=.05 5 | 6 | heap [shape=record, height=3, label="1 page|2 pages|3 pages|...|255 pages|rest"] 7 | O0 [shape=record, label=""] 8 | O1 [shape=record, label=""] 9 | O2 [shape=record, label="{|}"] 10 | O3 [shape=record, label="{|}"] 11 | O4 [shape=record, label="{||}"] 12 | O5 [shape=record, label="{||}"] 13 | O6 [shape=record, label="{|...|}"] 14 | O7 [shape=record, label="{|...|}"] 15 | O8 [shape=record, label="{|.....|}"] 16 | O9 [shape=record, label="{|.....|}"] 17 | sep1 [shape=plaintext, label="..."] 18 | sep2 [shape=plaintext, label="..."] 19 | sep3 [shape=plaintext, label="..."] 20 | sep4 [shape=plaintext, label="..."] 21 | sep5 [shape=plaintext, label="..."] 22 | 23 | heap:f0 -> O0 -> O1 -> sep1 24 | heap:f1 -> O2 -> O3 -> sep2 25 | heap:f2 -> O4 -> O5 -> sep3 26 | heap:f255 -> O6 -> O7 -> sep4 27 | heap:frest -> O8 -> O9 -> sep5 28 | 29 | } 30 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/pageheap.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/pageheap.gif -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/pprof-test-big.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/pprof-test-big.gif -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/pprof-test.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/pprof-test.gif -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/pprof-vsnprintf-big.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/pprof-vsnprintf-big.gif -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/pprof-vsnprintf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/pprof-vsnprintf.gif -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/spanmap.dot: -------------------------------------------------------------------------------- 1 | digraph SpanMap { 2 | node [shape=box, width=0.3, height=0.3] 3 | nodesep=.05 4 | 5 | map [shape=record, width=6, label="||||||||||"] 6 | S0 [label="a"] 7 | S1 [label="b"] 8 | S2 [label="c"] 9 | S3 [label="d"] 10 | map:f0 -> S0 11 | map:f1 -> S0 12 | map:f2 -> S1 13 | map:f3 -> S2 14 | map:f4 -> S2 15 | map:f5 -> S2 16 | map:f6 -> S2 17 | map:f7 -> S2 18 | map:f8 -> S3 19 | map:f9 -> S3 20 | map:f10 -> S3 21 | 22 | } 23 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/spanmap.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/spanmap.gif -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.1024.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.1024.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.128.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.128.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.131072.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.131072.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.16384.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.16384.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.2048.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.2048.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.256.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.256.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.32768.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.32768.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.4096.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.4096.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.512.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.512.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.64.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.64.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.65536.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.65536.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.8192.bytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspercpusec.vs.threads.8192.bytes.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.1.threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.1.threads.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.12.threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.12.threads.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.16.threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.16.threads.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.2.threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.2.threads.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.20.threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.20.threads.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.3.threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.3.threads.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.4.threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.4.threads.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.5.threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.5.threads.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.8.threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/tcmalloc-opspersec.vs.size.8.threads.png -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/threadheap.dot: -------------------------------------------------------------------------------- 1 | digraph ThreadHeap { 2 | rankdir=LR 3 | node [shape=box, width=0.3, height=0.3] 4 | nodesep=.05 5 | 6 | heap [shape=record, height=2, label="class 0|class 1|class 2|..."] 7 | O0 [label=""] 8 | O1 [label=""] 9 | O2 [label=""] 10 | O3 [label=""] 11 | O4 [label=""] 12 | O5 [label=""] 13 | sep1 [shape=plaintext, label="..."] 14 | sep2 [shape=plaintext, label="..."] 15 | sep3 [shape=plaintext, label="..."] 16 | 17 | heap:f0 -> O0 -> O1 -> sep1 18 | heap:f1 -> O2 -> O3 -> sep2 19 | heap:f2 -> O4 -> O5 -> sep3 20 | 21 | } 22 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/doc/threadheap.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/doc/threadheap.gif -------------------------------------------------------------------------------- /deps/gperftools-2.0/m4/ac_have_attribute.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AX_C___ATTRIBUTE__], [ 2 | AC_MSG_CHECKING(for __attribute__) 3 | AC_CACHE_VAL(ac_cv___attribute__, [ 4 | AC_TRY_COMPILE( 5 | [#include 6 | static void foo(void) __attribute__ ((unused)); 7 | void foo(void) { exit(1); }], 8 | [], 9 | ac_cv___attribute__=yes, 10 | ac_cv___attribute__=no 11 | )]) 12 | if test "$ac_cv___attribute__" = "yes"; then 13 | AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__]) 14 | fi 15 | AC_MSG_RESULT($ac_cv___attribute__) 16 | ]) 17 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/m4/acx_nanosleep.m4: -------------------------------------------------------------------------------- 1 | # Check for support for nanosleep. It's defined in , but on 2 | # some systems, such as solaris, you need to link in a library to use it. 3 | # We set acx_nanosleep_ok if nanosleep is supported; in that case, 4 | # NANOSLEEP_LIBS is set to whatever libraries are needed to support 5 | # nanosleep. 6 | 7 | AC_DEFUN([ACX_NANOSLEEP], 8 | [AC_MSG_CHECKING(if nanosleep requires any libraries) 9 | AC_LANG_SAVE 10 | AC_LANG_C 11 | acx_nanosleep_ok="no" 12 | NANOSLEEP_LIBS= 13 | # For most folks, this should just work 14 | AC_TRY_LINK([#include ], 15 | [static struct timespec ts; nanosleep(&ts, NULL);], 16 | [acx_nanosleep_ok=yes]) 17 | # For solaris, we may need -lrt 18 | if test "x$acx_nanosleep_ok" != "xyes"; then 19 | OLD_LIBS="$LIBS" 20 | LIBS="-lrt $LIBS" 21 | AC_TRY_LINK([#include ], 22 | [static struct timespec ts; nanosleep(&ts, NULL);], 23 | [acx_nanosleep_ok=yes]) 24 | if test "x$acx_nanosleep_ok" = "xyes"; then 25 | NANOSLEEP_LIBS="-lrt" 26 | fi 27 | LIBS="$OLD_LIBS" 28 | fi 29 | if test "x$acx_nanosleep_ok" != "xyes"; then 30 | AC_MSG_ERROR([cannot find the nanosleep function]) 31 | else 32 | AC_MSG_RESULT(${NANOSLEEP_LIBS:-no}) 33 | fi 34 | AC_LANG_RESTORE 35 | ]) 36 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/m4/compiler_characteristics.m4: -------------------------------------------------------------------------------- 1 | # Check compiler characteristics (e.g. type sizes, PRIxx macros, ...) 2 | 3 | # If types $1 and $2 are compatible, perform action $3 4 | AC_DEFUN([AC_TYPES_COMPATIBLE], 5 | [AC_TRY_COMPILE([#include ], [$1 v1 = 0; $2 v2 = 0; return (&v1 - &v2)], $3)]) 6 | 7 | define(AC_PRIUS_COMMENT, [printf format code for printing a size_t and ssize_t]) 8 | 9 | AC_DEFUN([AC_COMPILER_CHARACTERISTICS], 10 | [AC_CACHE_CHECK(AC_PRIUS_COMMENT, ac_cv_formatting_prius_prefix, 11 | [AC_TYPES_COMPATIBLE(unsigned int, size_t, 12 | ac_cv_formatting_prius_prefix=; ac_cv_prius_defined=1) 13 | AC_TYPES_COMPATIBLE(unsigned long, size_t, 14 | ac_cv_formatting_prius_prefix=l; ac_cv_prius_defined=1) 15 | AC_TYPES_COMPATIBLE(unsigned long long, size_t, 16 | ac_cv_formatting_prius_prefix=ll; ac_cv_prius_defined=1 17 | )]) 18 | if test -z "$ac_cv_prius_defined"; then 19 | ac_cv_formatting_prius_prefix=z; 20 | fi 21 | AC_DEFINE_UNQUOTED(PRIuS, "${ac_cv_formatting_prius_prefix}u", AC_PRIUS_COMMENT) 22 | AC_DEFINE_UNQUOTED(PRIxS, "${ac_cv_formatting_prius_prefix}x", AC_PRIUS_COMMENT) 23 | AC_DEFINE_UNQUOTED(PRIdS, "${ac_cv_formatting_prius_prefix}d", AC_PRIUS_COMMENT) 24 | ]) 25 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/m4/install_prefix.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AC_INSTALL_PREFIX], 2 | [ac_cv_install_prefix="$prefix"; 3 | if test x"$ac_cv_install_prefix" = x"NONE" ; then 4 | ac_cv_install_prefix="$ac_default_prefix"; 5 | fi 6 | AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "$ac_cv_install_prefix", 7 | [prefix where we look for installed files]) 8 | ]) 9 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # Generated from ltversion.in. 11 | 12 | # serial 3017 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.6b]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3017]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.2.6b' 20 | macro_revision='1.3017' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/m4/namespaces.m4: -------------------------------------------------------------------------------- 1 | # Checks whether the compiler implements namespaces 2 | AC_DEFUN([AC_CXX_NAMESPACES], 3 | [AC_CACHE_CHECK(whether the compiler implements namespaces, 4 | ac_cv_cxx_namespaces, 5 | [AC_LANG_SAVE 6 | AC_LANG_CPLUSPLUS 7 | AC_TRY_COMPILE([namespace Outer { 8 | namespace Inner { int i = 0; }}], 9 | [using namespace Outer::Inner; return i;], 10 | ac_cv_cxx_namespaces=yes, 11 | ac_cv_cxx_namespaces=no) 12 | AC_LANG_RESTORE]) 13 | if test "$ac_cv_cxx_namespaces" = yes; then 14 | AC_DEFINE(HAVE_NAMESPACES, 1, [define if the compiler implements namespaces]) 15 | fi]) 16 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/m4/program_invocation_name.m4: -------------------------------------------------------------------------------- 1 | # We need to be careful to avoid having the reference to 2 | # program_invocation_name optimized out. We do that by 3 | # returning the value. 4 | 5 | AC_DEFUN([AC_PROGRAM_INVOCATION_NAME], 6 | [AC_CACHE_CHECK( 7 | for program_invocation_name, 8 | ac_cv_have_program_invocation_name, 9 | AC_TRY_LINK([extern char* program_invocation_name;], 10 | [return *program_invocation_name;], 11 | [ac_cv_have_program_invocation_name=yes], 12 | [ac_cv_have_program_invocation_name=no]) 13 | ) 14 | if test "$ac_cv_have_program_invocation_name" = "yes"; then 15 | AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME, 1, 16 | [define if libc has program_invocation_name]) 17 | fi 18 | ]) 19 | 20 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/m4/stl_namespace.m4: -------------------------------------------------------------------------------- 1 | # We check what namespace stl code like vector expects to be executed in 2 | 3 | AC_DEFUN([AC_CXX_STL_NAMESPACE], 4 | [AC_CACHE_CHECK( 5 | what namespace STL code is in, 6 | ac_cv_cxx_stl_namespace, 7 | [AC_REQUIRE([AC_CXX_NAMESPACES]) 8 | AC_LANG_SAVE 9 | AC_LANG_CPLUSPLUS 10 | AC_TRY_COMPILE([#include ], 11 | [vector t; return 0;], 12 | ac_cv_cxx_stl_namespace=none) 13 | AC_TRY_COMPILE([#include ], 14 | [std::vector t; return 0;], 15 | ac_cv_cxx_stl_namespace=std) 16 | AC_LANG_RESTORE]) 17 | if test "$ac_cv_cxx_stl_namespace" = none; then 18 | AC_DEFINE(STL_NAMESPACE,, 19 | [the namespace where STL code like vector<> is defined]) 20 | fi 21 | if test "$ac_cv_cxx_stl_namespace" = std; then 22 | AC_DEFINE(STL_NAMESPACE,std, 23 | [the namespace where STL code like vector<> is defined]) 24 | fi 25 | ]) 26 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/packages/deb/README: -------------------------------------------------------------------------------- 1 | The list of files here isn't complete. For a step-by-step guide on 2 | how to set this package up correctly, check out 3 | http://www.debian.org/doc/maint-guide/ 4 | 5 | Most of the files that are in this directory are boilerplate. 6 | However, you may need to change the list of binary-arch dependencies 7 | in 'rules'. 8 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/packages/deb/compat: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/packages/deb/control: -------------------------------------------------------------------------------- 1 | Source: gperftools 2 | Priority: optional 3 | Maintainer: Google Inc. and others 4 | Build-Depends: debhelper (>= 4.0.0), binutils 5 | Standards-Version: 3.6.1 6 | 7 | Package: libgperftools-dev 8 | Section: libdevel 9 | Architecture: any 10 | Depends: libgperftools0 (= ${Source-Version}) 11 | Description: libraries for CPU and heap analysis, plus an efficient thread-caching malloc 12 | The gperftools package contains some utilities to improve and 13 | analyze the performance of C++ programs. This includes an optimized 14 | thread-caching malloc() and cpu and heap profiling utilities. The 15 | devel package contains static and debug libraries and header files 16 | for developing applications that use the gperftools package. 17 | 18 | Package: libgperftools0 19 | Section: libs 20 | Architecture: any 21 | Depends: ${shlibs:Depends} 22 | Description: libraries for CPU and heap analysis, plus an efficient thread-caching malloc 23 | The gperftools package contains some utilities to improve and 24 | analyze the performance of C++ programs. This includes an optimized 25 | thread-caching malloc() and cpu and heap profiling utilities. 26 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/packages/deb/docs: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | COPYING 3 | ChangeLog 4 | INSTALL 5 | NEWS 6 | README 7 | TODO 8 | doc/cpuprofile.html 9 | doc/cpuprofile-fileformat.html 10 | doc/designstyle.css 11 | doc/heap-example1.png 12 | doc/heap_checker.html 13 | doc/heapprofile.html 14 | doc/index.html 15 | doc/overview.gif 16 | doc/pageheap.gif 17 | doc/pprof-test-big.gif 18 | doc/pprof-test.gif 19 | doc/pprof-vsnprintf-big.gif 20 | doc/pprof-vsnprintf.gif 21 | doc/pprof.1 22 | doc/pprof_remote_servers.html 23 | doc/spanmap.gif 24 | doc/t-test1.times.txt 25 | doc/tcmalloc-opspercpusec.vs.threads.1024.bytes.png 26 | doc/tcmalloc-opspercpusec.vs.threads.128.bytes.png 27 | doc/tcmalloc-opspercpusec.vs.threads.131072.bytes.png 28 | doc/tcmalloc-opspercpusec.vs.threads.16384.bytes.png 29 | doc/tcmalloc-opspercpusec.vs.threads.2048.bytes.png 30 | doc/tcmalloc-opspercpusec.vs.threads.256.bytes.png 31 | doc/tcmalloc-opspercpusec.vs.threads.32768.bytes.png 32 | doc/tcmalloc-opspercpusec.vs.threads.4096.bytes.png 33 | doc/tcmalloc-opspercpusec.vs.threads.512.bytes.png 34 | doc/tcmalloc-opspercpusec.vs.threads.64.bytes.png 35 | doc/tcmalloc-opspercpusec.vs.threads.65536.bytes.png 36 | doc/tcmalloc-opspercpusec.vs.threads.8192.bytes.png 37 | doc/tcmalloc-opspersec.vs.size.1.threads.png 38 | doc/tcmalloc-opspersec.vs.size.12.threads.png 39 | doc/tcmalloc-opspersec.vs.size.16.threads.png 40 | doc/tcmalloc-opspersec.vs.size.2.threads.png 41 | doc/tcmalloc-opspersec.vs.size.20.threads.png 42 | doc/tcmalloc-opspersec.vs.size.3.threads.png 43 | doc/tcmalloc-opspersec.vs.size.4.threads.png 44 | doc/tcmalloc-opspersec.vs.size.5.threads.png 45 | doc/tcmalloc-opspersec.vs.size.8.threads.png 46 | doc/tcmalloc.html 47 | doc/threadheap.gif 48 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/packages/deb/libgperftools-dev.dirs: -------------------------------------------------------------------------------- 1 | usr/lib 2 | usr/lib/pkgconfig 3 | usr/include 4 | usr/include/google 5 | usr/include/gperftools 6 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/packages/deb/libgperftools-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/google/* 2 | usr/include/gperftools/* 3 | usr/lib/lib*.so 4 | usr/lib/lib*.a 5 | usr/lib/*.la 6 | usr/lib/pkgconfig/*.pc 7 | debian/tmp/usr/include/google/* 8 | debian/tmp/usr/include/gperftools/* 9 | debian/tmp/usr/lib/lib*.so 10 | debian/tmp/usr/lib/lib*.a 11 | debian/tmp/usr/lib/*.la 12 | debian/tmp/usr/lib/pkgconfig/*.pc 13 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/packages/deb/libgperftools0.dirs: -------------------------------------------------------------------------------- 1 | usr/lib 2 | usr/bin 3 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/packages/deb/libgperftools0.install: -------------------------------------------------------------------------------- 1 | usr/lib/lib*.so.* 2 | usr/bin/pprof* 3 | debian/tmp/usr/lib/lib*.so.* 4 | debian/tmp/usr/bin/pprof* 5 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/packages/deb/libgperftools0.manpages: -------------------------------------------------------------------------------- 1 | doc/pprof.1 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/src/google/heap-checker.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | /* The code has moved to gperftools/. Use that include-directory for 31 | * new code. 32 | */ 33 | #include 34 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/src/google/malloc_hook.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | /* The code has moved to gperftools/. Use that include-directory for 31 | * new code. 32 | */ 33 | #include 34 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/src/google/stacktrace.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | /* The code has moved to gperftools/. Use that include-directory for 31 | * new code. 32 | */ 33 | #include 34 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/src/solaris/libstdc++.la: -------------------------------------------------------------------------------- 1 | # libstdc++.la - a libtool library file 2 | # Generated by ltmain.sh - GNU libtool 1.4a-GCC3.0 (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # --- 8 | # NOTE: This file lives in /usr/sfw/lib on Solaris 10. Unfortunately, 9 | # due to an apparent bug in the Solaris 10 6/06 release, 10 | # /usr/sfw/lib/libstdc++.la is empty. Below is the correct content, 11 | # according to 12 | # http://forum.java.sun.com/thread.jspa?threadID=5073150 13 | # By passing LDFLAGS='-Lsrc/solaris' to configure, make will pick up 14 | # this copy of the file rather than the empty copy in /usr/sfw/lib. 15 | # 16 | # Also see 17 | # http://www.technicalarticles.org/index.php/Compiling_MySQL_5.0_on_Solaris_10 18 | # 19 | # Note: this is for 32-bit systems. If you have a 64-bit system, 20 | # uncomment the appropriate dependency_libs line below. 21 | # ---- 22 | 23 | # The name that we can dlopen(3). 24 | dlname='libstdc++.so.6' 25 | 26 | # Names of this library. 27 | library_names='libstdc++.so.6.0.3 libstdc++.so.6 libstdc++.so' 28 | 29 | # The name of the static archive. 30 | old_library='libstdc++.a' 31 | 32 | # Libraries that this one depends upon. 33 | # 32-bit version: 34 | dependency_libs='-lc -lm -L/usr/sfw/lib -lgcc_s' 35 | # 64-bit version: 36 | #dependency_libs='-L/lib/64 -lc -lm -L/usr/sfw/lib/64 -lgcc_s' 37 | 38 | # Version information for libstdc++. 39 | current=6 40 | age=0 41 | revision=3 42 | 43 | # Is this an already installed library? 44 | installed=yes 45 | 46 | # Files to dlopen/dlpreopen 47 | dlopen='' 48 | dlpreopen='' 49 | 50 | # Directory that this library needs to be installed in: 51 | libdir='/usr/sfw/lib' 52 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/src/stamp-h1: -------------------------------------------------------------------------------- 1 | timestamp for src/config.h 2 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/src/tests/page_heap_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009 Google Inc. All Rights Reserved. 2 | // Author: fikes@google.com (Andrew Fikes) 3 | 4 | #include "config_for_unittests.h" 5 | #include "page_heap.h" 6 | #include 7 | #include "base/logging.h" 8 | #include "common.h" 9 | 10 | namespace { 11 | 12 | static void CheckStats(const tcmalloc::PageHeap* ph, 13 | uint64_t system_pages, 14 | uint64_t free_pages, 15 | uint64_t unmapped_pages) { 16 | tcmalloc::PageHeap::Stats stats = ph->stats(); 17 | EXPECT_EQ(system_pages, stats.system_bytes >> kPageShift); 18 | EXPECT_EQ(free_pages, stats.free_bytes >> kPageShift); 19 | EXPECT_EQ(unmapped_pages, stats.unmapped_bytes >> kPageShift); 20 | } 21 | 22 | static void TestPageHeap_Stats() { 23 | tcmalloc::PageHeap* ph = new tcmalloc::PageHeap(); 24 | 25 | // Empty page heap 26 | CheckStats(ph, 0, 0, 0); 27 | 28 | // Allocate a span 's1' 29 | tcmalloc::Span* s1 = ph->New(256); 30 | CheckStats(ph, 256, 0, 0); 31 | 32 | // Split span 's1' into 's1', 's2'. Delete 's2' 33 | tcmalloc::Span* s2 = ph->Split(s1, 128); 34 | Length s2_len = s2->length; 35 | ph->Delete(s2); 36 | CheckStats(ph, 256, 128, 0); 37 | 38 | // Unmap deleted span 's2' 39 | EXPECT_EQ(s2_len, ph->ReleaseAtLeastNPages(1)); 40 | CheckStats(ph, 256, 0, 128); 41 | 42 | // Delete span 's1' 43 | ph->Delete(s1); 44 | CheckStats(ph, 256, 128, 128); 45 | 46 | delete ph; 47 | } 48 | 49 | } // namespace 50 | 51 | int main(int argc, char **argv) { 52 | TestPageHeap_Stats(); 53 | printf("PASS\n"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /deps/gperftools-2.0/src/windows/ia32_modrm_map.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/src/windows/ia32_modrm_map.cc -------------------------------------------------------------------------------- /deps/gperftools-2.0/src/windows/ia32_opcode_map.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/src/windows/ia32_opcode_map.cc -------------------------------------------------------------------------------- /deps/gperftools-2.0/src/windows/mini_disassembler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/gperftools-2.0/src/windows/mini_disassembler.h -------------------------------------------------------------------------------- /deps/hiredis/.gitignore: -------------------------------------------------------------------------------- 1 | /hiredis-test 2 | /hiredis-example* 3 | /*.o 4 | /*.so 5 | /*.dylib 6 | /*.a 7 | -------------------------------------------------------------------------------- /deps/hiredis/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### 0.10.1 2 | 3 | * Makefile overhaul. Important to check out if you override one or more 4 | variables using environment variables or via arguments to the "make" tool. 5 | 6 | * Issue #45: Fix potential memory leak for a multi bulk reply with 0 elements 7 | being created by the default reply object functions. 8 | 9 | * Issue #43: Don't crash in an asynchronous context when Redis returns an error 10 | reply after the connection has been made (this happens when the maximum 11 | number of connections is reached). 12 | 13 | ### 0.10.0 14 | 15 | * See commit log. 16 | 17 | -------------------------------------------------------------------------------- /deps/hiredis/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2011, Salvatore Sanfilippo 2 | Copyright (c) 2010-2011, Pieter Noordhuis 3 | 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of Redis nor the names of its contributors may be used 17 | to endorse or promote products derived from this software without specific 18 | prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 24 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 27 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /deps/hiredis/example-ae.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "hiredis.h" 6 | #include "async.h" 7 | #include "adapters/ae.h" 8 | 9 | /* Put event loop in the global scope, so it can be explicitly stopped */ 10 | static aeEventLoop *loop; 11 | 12 | void getCallback(redisAsyncContext *c, void *r, void *privdata) { 13 | redisReply *reply = r; 14 | if (reply == NULL) return; 15 | printf("argv[%s]: %s\n", (char*)privdata, reply->str); 16 | 17 | /* Disconnect after receiving the reply to GET */ 18 | redisAsyncDisconnect(c); 19 | } 20 | 21 | void connectCallback(const redisAsyncContext *c, int status) { 22 | if (status != REDIS_OK) { 23 | printf("Error: %s\n", c->errstr); 24 | return; 25 | } 26 | printf("Connected...\n"); 27 | } 28 | 29 | void disconnectCallback(const redisAsyncContext *c, int status) { 30 | if (status != REDIS_OK) { 31 | printf("Error: %s\n", c->errstr); 32 | return; 33 | } 34 | printf("Disconnected...\n"); 35 | } 36 | 37 | int main (int argc, char **argv) { 38 | signal(SIGPIPE, SIG_IGN); 39 | 40 | redisAsyncContext *c = redisAsyncConnect("127.0.0.1", 6379); 41 | if (c->err) { 42 | /* Let *c leak for now... */ 43 | printf("Error: %s\n", c->errstr); 44 | return 1; 45 | } 46 | 47 | loop = aeCreateEventLoop(); 48 | redisAeAttach(loop, c); 49 | redisAsyncSetConnectCallback(c,connectCallback); 50 | redisAsyncSetDisconnectCallback(c,disconnectCallback); 51 | redisAsyncCommand(c, NULL, NULL, "SET key %b", argv[argc-1], strlen(argv[argc-1])); 52 | redisAsyncCommand(c, getCallback, (char*)"end-1", "GET key"); 53 | aeMain(loop); 54 | return 0; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /deps/hiredis/example-libev.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "hiredis.h" 6 | #include "async.h" 7 | #include "adapters/libev.h" 8 | 9 | void getCallback(redisAsyncContext *c, void *r, void *privdata) { 10 | redisReply *reply = r; 11 | if (reply == NULL) return; 12 | printf("argv[%s]: %s\n", (char*)privdata, reply->str); 13 | 14 | /* Disconnect after receiving the reply to GET */ 15 | redisAsyncDisconnect(c); 16 | } 17 | 18 | void connectCallback(const redisAsyncContext *c, int status) { 19 | if (status != REDIS_OK) { 20 | printf("Error: %s\n", c->errstr); 21 | return; 22 | } 23 | printf("Connected...\n"); 24 | } 25 | 26 | void disconnectCallback(const redisAsyncContext *c, int status) { 27 | if (status != REDIS_OK) { 28 | printf("Error: %s\n", c->errstr); 29 | return; 30 | } 31 | printf("Disconnected...\n"); 32 | } 33 | 34 | int main (int argc, char **argv) { 35 | signal(SIGPIPE, SIG_IGN); 36 | 37 | redisAsyncContext *c = redisAsyncConnect("127.0.0.1", 6379); 38 | if (c->err) { 39 | /* Let *c leak for now... */ 40 | printf("Error: %s\n", c->errstr); 41 | return 1; 42 | } 43 | 44 | redisLibevAttach(EV_DEFAULT_ c); 45 | redisAsyncSetConnectCallback(c,connectCallback); 46 | redisAsyncSetDisconnectCallback(c,disconnectCallback); 47 | redisAsyncCommand(c, NULL, NULL, "SET key %b", argv[argc-1], strlen(argv[argc-1])); 48 | redisAsyncCommand(c, getCallback, (char*)"end-1", "GET key"); 49 | ev_loop(EV_DEFAULT_ 0); 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /deps/hiredis/example-libevent.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "hiredis.h" 6 | #include "async.h" 7 | #include "adapters/libevent.h" 8 | 9 | void getCallback(redisAsyncContext *c, void *r, void *privdata) { 10 | redisReply *reply = r; 11 | if (reply == NULL) return; 12 | printf("argv[%s]: %s\n", (char*)privdata, reply->str); 13 | 14 | /* Disconnect after receiving the reply to GET */ 15 | redisAsyncDisconnect(c); 16 | } 17 | 18 | void connectCallback(const redisAsyncContext *c, int status) { 19 | if (status != REDIS_OK) { 20 | printf("Error: %s\n", c->errstr); 21 | return; 22 | } 23 | printf("Connected...\n"); 24 | } 25 | 26 | void disconnectCallback(const redisAsyncContext *c, int status) { 27 | if (status != REDIS_OK) { 28 | printf("Error: %s\n", c->errstr); 29 | return; 30 | } 31 | printf("Disconnected...\n"); 32 | } 33 | 34 | int main (int argc, char **argv) { 35 | signal(SIGPIPE, SIG_IGN); 36 | struct event_base *base = event_base_new(); 37 | 38 | redisAsyncContext *c = redisAsyncConnect("127.0.0.1", 6379); 39 | if (c->err) { 40 | /* Let *c leak for now... */ 41 | printf("Error: %s\n", c->errstr); 42 | return 1; 43 | } 44 | 45 | redisLibeventAttach(c,base); 46 | redisAsyncSetConnectCallback(c,connectCallback); 47 | redisAsyncSetDisconnectCallback(c,disconnectCallback); 48 | redisAsyncCommand(c, NULL, NULL, "SET key %b", argv[argc-1], strlen(argv[argc-1])); 49 | redisAsyncCommand(c, getCallback, (char*)"end-1", "GET key"); 50 | event_base_dispatch(base); 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /deps/hiredis/fmacros.h: -------------------------------------------------------------------------------- 1 | #ifndef __HIREDIS_FMACRO_H 2 | #define __HIREDIS_FMACRO_H 3 | 4 | #if !defined(_BSD_SOURCE) 5 | #define _BSD_SOURCE 6 | #endif 7 | 8 | #if defined(__sun__) 9 | #define _POSIX_C_SOURCE 200112L 10 | #elif defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) 11 | #define _XOPEN_SOURCE 600 12 | #else 13 | #define _XOPEN_SOURCE 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /deps/jemalloc/.gitignore: -------------------------------------------------------------------------------- 1 | /autom4te.cache/ 2 | /config.stamp 3 | /config.log 4 | /config.status 5 | /doc/html.xsl 6 | /doc/manpages.xsl 7 | /doc/jemalloc.xml 8 | /lib/ 9 | /Makefile 10 | /include/jemalloc/internal/jemalloc_internal\.h 11 | /include/jemalloc/internal/size_classes\.h 12 | /include/jemalloc/jemalloc\.h 13 | /include/jemalloc/jemalloc_defs\.h 14 | /src/*.[od] 15 | /test/*.[od] 16 | /test/*.out 17 | /test/[a-zA-Z_]* 18 | !test/*.c 19 | !test/*.exp 20 | /bin/jemalloc.sh 21 | -------------------------------------------------------------------------------- /deps/jemalloc/COPYING: -------------------------------------------------------------------------------- 1 | Unless otherwise specified, files in the jemalloc source distribution are 2 | subject to the following license: 3 | -------------------------------------------------------------------------------- 4 | Copyright (C) 2002-2012 Jason Evans . 5 | All rights reserved. 6 | Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved. 7 | Copyright (C) 2009-2012 Facebook, Inc. All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions are met: 11 | 1. Redistributions of source code must retain the above copyright notice(s), 12 | this list of conditions and the following disclaimer. 13 | 2. Redistributions in binary form must reproduce the above copyright notice(s), 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS 18 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 20 | EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- 28 | -------------------------------------------------------------------------------- /deps/jemalloc/README: -------------------------------------------------------------------------------- 1 | jemalloc is a general-purpose scalable concurrent malloc(3) implementation. 2 | This distribution is a "portable" implementation that currently targets 3 | FreeBSD, Linux, Apple OS X, and MinGW. jemalloc is included as the default 4 | allocator in the FreeBSD and NetBSD operating systems, and it is used by the 5 | Mozilla Firefox web browser on Microsoft Windows-related platforms. Depending 6 | on your needs, one of the other divergent versions may suit your needs better 7 | than this distribution. 8 | 9 | The COPYING file contains copyright and licensing information. 10 | 11 | The INSTALL file contains information on how to configure, build, and install 12 | jemalloc. 13 | 14 | The ChangeLog file contains a brief summary of changes for each release. 15 | 16 | URL: http://www.canonware.com/jemalloc/ 17 | -------------------------------------------------------------------------------- /deps/jemalloc/VERSION: -------------------------------------------------------------------------------- 1 | 3.2.0-0-g87499f6748ebe4817571e817e9f680ccb5bf54a9 2 | -------------------------------------------------------------------------------- /deps/jemalloc/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for i in autoconf; do 4 | echo "$i" 5 | $i 6 | if [ $? -ne 0 ]; then 7 | echo "Error $? in $i" 8 | exit 1 9 | fi 10 | done 11 | 12 | echo "./configure --enable-autogen $@" 13 | ./configure --enable-autogen $@ 14 | if [ $? -ne 0 ]; then 15 | echo "Error $? in ./configure" 16 | exit 1 17 | fi 18 | -------------------------------------------------------------------------------- /deps/jemalloc/bin/jemalloc.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | 7 | @LD_PRELOAD_VAR@=${libdir}/libjemalloc.@SOREV@ 8 | export @LD_PRELOAD_VAR@ 9 | exec "$@" 10 | -------------------------------------------------------------------------------- /deps/jemalloc/config.stamp.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/jemalloc/config.stamp.in -------------------------------------------------------------------------------- /deps/jemalloc/doc/html.xsl.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /deps/jemalloc/doc/jemalloc.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/jemalloc/doc/jemalloc.html -------------------------------------------------------------------------------- /deps/jemalloc/doc/manpages.xsl.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /deps/jemalloc/doc/stylesheet.xsl: -------------------------------------------------------------------------------- 1 | 2 | ansi 3 | 4 | 5 | "" 6 | 7 | 8 | -------------------------------------------------------------------------------- /deps/jemalloc/include/jemalloc/internal/base.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | #ifdef JEMALLOC_H_TYPES 3 | 4 | #endif /* JEMALLOC_H_TYPES */ 5 | /******************************************************************************/ 6 | #ifdef JEMALLOC_H_STRUCTS 7 | 8 | #endif /* JEMALLOC_H_STRUCTS */ 9 | /******************************************************************************/ 10 | #ifdef JEMALLOC_H_EXTERNS 11 | 12 | void *base_alloc(size_t size); 13 | void *base_calloc(size_t number, size_t size); 14 | extent_node_t *base_node_alloc(void); 15 | void base_node_dealloc(extent_node_t *node); 16 | bool base_boot(void); 17 | void base_prefork(void); 18 | void base_postfork_parent(void); 19 | void base_postfork_child(void); 20 | 21 | #endif /* JEMALLOC_H_EXTERNS */ 22 | /******************************************************************************/ 23 | #ifdef JEMALLOC_H_INLINES 24 | 25 | #endif /* JEMALLOC_H_INLINES */ 26 | /******************************************************************************/ 27 | -------------------------------------------------------------------------------- /deps/jemalloc/include/jemalloc/internal/chunk_dss.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | #ifdef JEMALLOC_H_TYPES 3 | 4 | typedef enum { 5 | dss_prec_disabled = 0, 6 | dss_prec_primary = 1, 7 | dss_prec_secondary = 2, 8 | 9 | dss_prec_limit = 3 10 | } dss_prec_t ; 11 | #define DSS_PREC_DEFAULT dss_prec_secondary 12 | #define DSS_DEFAULT "secondary" 13 | 14 | #endif /* JEMALLOC_H_TYPES */ 15 | /******************************************************************************/ 16 | #ifdef JEMALLOC_H_STRUCTS 17 | 18 | extern const char *dss_prec_names[]; 19 | 20 | #endif /* JEMALLOC_H_STRUCTS */ 21 | /******************************************************************************/ 22 | #ifdef JEMALLOC_H_EXTERNS 23 | 24 | dss_prec_t chunk_dss_prec_get(void); 25 | bool chunk_dss_prec_set(dss_prec_t dss_prec); 26 | void *chunk_alloc_dss(size_t size, size_t alignment, bool *zero); 27 | bool chunk_in_dss(void *chunk); 28 | bool chunk_dss_boot(void); 29 | void chunk_dss_prefork(void); 30 | void chunk_dss_postfork_parent(void); 31 | void chunk_dss_postfork_child(void); 32 | 33 | #endif /* JEMALLOC_H_EXTERNS */ 34 | /******************************************************************************/ 35 | #ifdef JEMALLOC_H_INLINES 36 | 37 | #endif /* JEMALLOC_H_INLINES */ 38 | /******************************************************************************/ 39 | -------------------------------------------------------------------------------- /deps/jemalloc/include/jemalloc/internal/chunk_mmap.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | #ifdef JEMALLOC_H_TYPES 3 | 4 | #endif /* JEMALLOC_H_TYPES */ 5 | /******************************************************************************/ 6 | #ifdef JEMALLOC_H_STRUCTS 7 | 8 | #endif /* JEMALLOC_H_STRUCTS */ 9 | /******************************************************************************/ 10 | #ifdef JEMALLOC_H_EXTERNS 11 | 12 | bool pages_purge(void *addr, size_t length); 13 | 14 | void *chunk_alloc_mmap(size_t size, size_t alignment, bool *zero); 15 | bool chunk_dealloc_mmap(void *chunk, size_t size); 16 | 17 | #endif /* JEMALLOC_H_EXTERNS */ 18 | /******************************************************************************/ 19 | #ifdef JEMALLOC_H_INLINES 20 | 21 | #endif /* JEMALLOC_H_INLINES */ 22 | /******************************************************************************/ 23 | -------------------------------------------------------------------------------- /deps/jemalloc/include/jemalloc/internal/extent.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | #ifdef JEMALLOC_H_TYPES 3 | 4 | typedef struct extent_node_s extent_node_t; 5 | 6 | #endif /* JEMALLOC_H_TYPES */ 7 | /******************************************************************************/ 8 | #ifdef JEMALLOC_H_STRUCTS 9 | 10 | /* Tree of extents. */ 11 | struct extent_node_s { 12 | /* Linkage for the size/address-ordered tree. */ 13 | rb_node(extent_node_t) link_szad; 14 | 15 | /* Linkage for the address-ordered tree. */ 16 | rb_node(extent_node_t) link_ad; 17 | 18 | /* Profile counters, used for huge objects. */ 19 | prof_ctx_t *prof_ctx; 20 | 21 | /* Pointer to the extent that this tree node is responsible for. */ 22 | void *addr; 23 | 24 | /* Total region size. */ 25 | size_t size; 26 | 27 | /* True if zero-filled; used by chunk recycling code. */ 28 | bool zeroed; 29 | }; 30 | typedef rb_tree(extent_node_t) extent_tree_t; 31 | 32 | #endif /* JEMALLOC_H_STRUCTS */ 33 | /******************************************************************************/ 34 | #ifdef JEMALLOC_H_EXTERNS 35 | 36 | rb_proto(, extent_tree_szad_, extent_tree_t, extent_node_t) 37 | 38 | rb_proto(, extent_tree_ad_, extent_tree_t, extent_node_t) 39 | 40 | #endif /* JEMALLOC_H_EXTERNS */ 41 | /******************************************************************************/ 42 | #ifdef JEMALLOC_H_INLINES 43 | 44 | #endif /* JEMALLOC_H_INLINES */ 45 | /******************************************************************************/ 46 | 47 | -------------------------------------------------------------------------------- /deps/jemalloc/include/jemalloc/internal/huge.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | #ifdef JEMALLOC_H_TYPES 3 | 4 | #endif /* JEMALLOC_H_TYPES */ 5 | /******************************************************************************/ 6 | #ifdef JEMALLOC_H_STRUCTS 7 | 8 | #endif /* JEMALLOC_H_STRUCTS */ 9 | /******************************************************************************/ 10 | #ifdef JEMALLOC_H_EXTERNS 11 | 12 | /* Huge allocation statistics. */ 13 | extern uint64_t huge_nmalloc; 14 | extern uint64_t huge_ndalloc; 15 | extern size_t huge_allocated; 16 | 17 | /* Protects chunk-related data structures. */ 18 | extern malloc_mutex_t huge_mtx; 19 | 20 | void *huge_malloc(size_t size, bool zero); 21 | void *huge_palloc(size_t size, size_t alignment, bool zero); 22 | void *huge_ralloc_no_move(void *ptr, size_t oldsize, size_t size, 23 | size_t extra); 24 | void *huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, 25 | size_t alignment, bool zero, bool try_tcache_dalloc); 26 | void huge_dalloc(void *ptr, bool unmap); 27 | size_t huge_salloc(const void *ptr); 28 | prof_ctx_t *huge_prof_ctx_get(const void *ptr); 29 | void huge_prof_ctx_set(const void *ptr, prof_ctx_t *ctx); 30 | bool huge_boot(void); 31 | void huge_prefork(void); 32 | void huge_postfork_parent(void); 33 | void huge_postfork_child(void); 34 | 35 | #endif /* JEMALLOC_H_EXTERNS */ 36 | /******************************************************************************/ 37 | #ifdef JEMALLOC_H_INLINES 38 | 39 | #endif /* JEMALLOC_H_INLINES */ 40 | /******************************************************************************/ 41 | -------------------------------------------------------------------------------- /deps/jemalloc/include/jemalloc/internal/quarantine.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | #ifdef JEMALLOC_H_TYPES 3 | 4 | /* Default per thread quarantine size if valgrind is enabled. */ 5 | #define JEMALLOC_VALGRIND_QUARANTINE_DEFAULT (ZU(1) << 24) 6 | 7 | #endif /* JEMALLOC_H_TYPES */ 8 | /******************************************************************************/ 9 | #ifdef JEMALLOC_H_STRUCTS 10 | 11 | #endif /* JEMALLOC_H_STRUCTS */ 12 | /******************************************************************************/ 13 | #ifdef JEMALLOC_H_EXTERNS 14 | 15 | void quarantine(void *ptr); 16 | bool quarantine_boot(void); 17 | 18 | #endif /* JEMALLOC_H_EXTERNS */ 19 | /******************************************************************************/ 20 | #ifdef JEMALLOC_H_INLINES 21 | 22 | #endif /* JEMALLOC_H_INLINES */ 23 | /******************************************************************************/ 24 | 25 | -------------------------------------------------------------------------------- /deps/jemalloc/include/msvc_compat/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef stdbool_h 2 | #define stdbool_h 3 | 4 | #include 5 | 6 | /* MSVC doesn't define _Bool or bool in C, but does have BOOL */ 7 | /* Note this doesn't pass autoconf's test because (bool) 0.5 != true */ 8 | typedef BOOL _Bool; 9 | 10 | #define bool _Bool 11 | #define true 1 12 | #define false 0 13 | 14 | #define __bool_true_false_are_defined 1 15 | 16 | #endif /* stdbool_h */ 17 | -------------------------------------------------------------------------------- /deps/jemalloc/include/msvc_compat/strings.h: -------------------------------------------------------------------------------- 1 | #ifndef strings_h 2 | #define strings_h 3 | 4 | /* MSVC doesn't define ffs/ffsl. This dummy strings.h header is provided 5 | * for both */ 6 | #include 7 | #pragma intrinsic(_BitScanForward) 8 | static __forceinline int ffsl(long x) 9 | { 10 | unsigned long i; 11 | 12 | if (_BitScanForward(&i, x)) 13 | return (i + 1); 14 | return (0); 15 | } 16 | 17 | static __forceinline int ffs(int x) 18 | { 19 | 20 | return (ffsl(x)); 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /deps/jemalloc/src/atomic.c: -------------------------------------------------------------------------------- 1 | #define JEMALLOC_ATOMIC_C_ 2 | #include "jemalloc/internal/jemalloc_internal.h" 3 | -------------------------------------------------------------------------------- /deps/jemalloc/src/extent.c: -------------------------------------------------------------------------------- 1 | #define JEMALLOC_EXTENT_C_ 2 | #include "jemalloc/internal/jemalloc_internal.h" 3 | 4 | /******************************************************************************/ 5 | 6 | static inline int 7 | extent_szad_comp(extent_node_t *a, extent_node_t *b) 8 | { 9 | int ret; 10 | size_t a_size = a->size; 11 | size_t b_size = b->size; 12 | 13 | ret = (a_size > b_size) - (a_size < b_size); 14 | if (ret == 0) { 15 | uintptr_t a_addr = (uintptr_t)a->addr; 16 | uintptr_t b_addr = (uintptr_t)b->addr; 17 | 18 | ret = (a_addr > b_addr) - (a_addr < b_addr); 19 | } 20 | 21 | return (ret); 22 | } 23 | 24 | /* Generate red-black tree functions. */ 25 | rb_gen(, extent_tree_szad_, extent_tree_t, extent_node_t, link_szad, 26 | extent_szad_comp) 27 | 28 | static inline int 29 | extent_ad_comp(extent_node_t *a, extent_node_t *b) 30 | { 31 | uintptr_t a_addr = (uintptr_t)a->addr; 32 | uintptr_t b_addr = (uintptr_t)b->addr; 33 | 34 | return ((a_addr > b_addr) - (a_addr < b_addr)); 35 | } 36 | 37 | /* Generate red-black tree functions. */ 38 | rb_gen(, extent_tree_ad_, extent_tree_t, extent_node_t, link_ad, 39 | extent_ad_comp) 40 | -------------------------------------------------------------------------------- /deps/jemalloc/src/hash.c: -------------------------------------------------------------------------------- 1 | #define JEMALLOC_HASH_C_ 2 | #include "jemalloc/internal/jemalloc_internal.h" 3 | -------------------------------------------------------------------------------- /deps/jemalloc/src/mb.c: -------------------------------------------------------------------------------- 1 | #define JEMALLOC_MB_C_ 2 | #include "jemalloc/internal/jemalloc_internal.h" 3 | -------------------------------------------------------------------------------- /deps/jemalloc/src/rtree.c: -------------------------------------------------------------------------------- 1 | #define JEMALLOC_RTREE_C_ 2 | #include "jemalloc/internal/jemalloc_internal.h" 3 | 4 | rtree_t * 5 | rtree_new(unsigned bits) 6 | { 7 | rtree_t *ret; 8 | unsigned bits_per_level, height, i; 9 | 10 | bits_per_level = ffs(pow2_ceil((RTREE_NODESIZE / sizeof(void *)))) - 1; 11 | height = bits / bits_per_level; 12 | if (height * bits_per_level != bits) 13 | height++; 14 | assert(height * bits_per_level >= bits); 15 | 16 | ret = (rtree_t*)base_alloc(offsetof(rtree_t, level2bits) + 17 | (sizeof(unsigned) * height)); 18 | if (ret == NULL) 19 | return (NULL); 20 | memset(ret, 0, offsetof(rtree_t, level2bits) + (sizeof(unsigned) * 21 | height)); 22 | 23 | if (malloc_mutex_init(&ret->mutex)) { 24 | /* Leak the rtree. */ 25 | return (NULL); 26 | } 27 | ret->height = height; 28 | if (bits_per_level * height > bits) 29 | ret->level2bits[0] = bits % bits_per_level; 30 | else 31 | ret->level2bits[0] = bits_per_level; 32 | for (i = 1; i < height; i++) 33 | ret->level2bits[i] = bits_per_level; 34 | 35 | ret->root = (void**)base_alloc(sizeof(void *) << ret->level2bits[0]); 36 | if (ret->root == NULL) { 37 | /* 38 | * We leak the rtree here, since there's no generic base 39 | * deallocation. 40 | */ 41 | return (NULL); 42 | } 43 | memset(ret->root, 0, sizeof(void *) << ret->level2bits[0]); 44 | 45 | return (ret); 46 | } 47 | 48 | void 49 | rtree_prefork(rtree_t *rtree) 50 | { 51 | 52 | malloc_mutex_prefork(&rtree->mutex); 53 | } 54 | 55 | void 56 | rtree_postfork_parent(rtree_t *rtree) 57 | { 58 | 59 | malloc_mutex_postfork_parent(&rtree->mutex); 60 | } 61 | 62 | void 63 | rtree_postfork_child(rtree_t *rtree) 64 | { 65 | 66 | malloc_mutex_postfork_child(&rtree->mutex); 67 | } 68 | -------------------------------------------------------------------------------- /deps/jemalloc/test/ALLOCM_ARENA.c: -------------------------------------------------------------------------------- 1 | #define JEMALLOC_MANGLE 2 | #include "jemalloc_test.h" 3 | 4 | #define NTHREADS 10 5 | 6 | void * 7 | je_thread_start(void *arg) 8 | { 9 | unsigned thread_ind = (unsigned)(uintptr_t)arg; 10 | unsigned arena_ind; 11 | int r; 12 | void *p; 13 | size_t rsz, sz; 14 | 15 | sz = sizeof(arena_ind); 16 | if (mallctl("arenas.extend", &arena_ind, &sz, NULL, 0) 17 | != 0) { 18 | malloc_printf("Error in arenas.extend\n"); 19 | abort(); 20 | } 21 | 22 | if (thread_ind % 4 != 3) { 23 | size_t mib[3]; 24 | size_t miblen = sizeof(mib) / sizeof(size_t); 25 | const char *dss_precs[] = {"disabled", "primary", "secondary"}; 26 | const char *dss = dss_precs[thread_ind % 4]; 27 | if (mallctlnametomib("arena.0.dss", mib, &miblen) != 0) { 28 | malloc_printf("Error in mallctlnametomib()\n"); 29 | abort(); 30 | } 31 | mib[1] = arena_ind; 32 | if (mallctlbymib(mib, miblen, NULL, NULL, (void *)&dss, 33 | sizeof(const char *))) { 34 | malloc_printf("Error in mallctlbymib()\n"); 35 | abort(); 36 | } 37 | } 38 | 39 | r = allocm(&p, &rsz, 1, ALLOCM_ARENA(arena_ind)); 40 | if (r != ALLOCM_SUCCESS) { 41 | malloc_printf("Unexpected allocm() error\n"); 42 | abort(); 43 | } 44 | 45 | return (NULL); 46 | } 47 | 48 | int 49 | main(void) 50 | { 51 | je_thread_t threads[NTHREADS]; 52 | unsigned i; 53 | 54 | malloc_printf("Test begin\n"); 55 | 56 | for (i = 0; i < NTHREADS; i++) { 57 | je_thread_create(&threads[i], je_thread_start, 58 | (void *)(uintptr_t)i); 59 | } 60 | 61 | for (i = 0; i < NTHREADS; i++) 62 | je_thread_join(threads[i], NULL); 63 | 64 | malloc_printf("Test end\n"); 65 | return (0); 66 | } 67 | -------------------------------------------------------------------------------- /deps/jemalloc/test/ALLOCM_ARENA.exp: -------------------------------------------------------------------------------- 1 | Test begin 2 | Test end 3 | -------------------------------------------------------------------------------- /deps/jemalloc/test/aligned_alloc.exp: -------------------------------------------------------------------------------- 1 | Test begin 2 | Alignment: 8 3 | Alignment: 16 4 | Alignment: 32 5 | Alignment: 64 6 | Alignment: 128 7 | Alignment: 256 8 | Alignment: 512 9 | Alignment: 1024 10 | Alignment: 2048 11 | Alignment: 4096 12 | Alignment: 8192 13 | Alignment: 16384 14 | Alignment: 32768 15 | Alignment: 65536 16 | Alignment: 131072 17 | Alignment: 262144 18 | Alignment: 524288 19 | Alignment: 1048576 20 | Alignment: 2097152 21 | Alignment: 4194304 22 | Alignment: 8388608 23 | Alignment: 16777216 24 | Alignment: 33554432 25 | Test end 26 | -------------------------------------------------------------------------------- /deps/jemalloc/test/allocated.exp: -------------------------------------------------------------------------------- 1 | Test begin 2 | Test end 3 | -------------------------------------------------------------------------------- /deps/jemalloc/test/allocm.exp: -------------------------------------------------------------------------------- 1 | Test begin 2 | Alignment: 8 3 | Alignment: 16 4 | Alignment: 32 5 | Alignment: 64 6 | Alignment: 128 7 | Alignment: 256 8 | Alignment: 512 9 | Alignment: 1024 10 | Alignment: 2048 11 | Alignment: 4096 12 | Alignment: 8192 13 | Alignment: 16384 14 | Alignment: 32768 15 | Alignment: 65536 16 | Alignment: 131072 17 | Alignment: 262144 18 | Alignment: 524288 19 | Alignment: 1048576 20 | Alignment: 2097152 21 | Alignment: 4194304 22 | Alignment: 8388608 23 | Alignment: 16777216 24 | Alignment: 33554432 25 | Test end 26 | -------------------------------------------------------------------------------- /deps/jemalloc/test/bitmap.exp: -------------------------------------------------------------------------------- 1 | Test begin 2 | Test end 3 | -------------------------------------------------------------------------------- /deps/jemalloc/test/mremap.c: -------------------------------------------------------------------------------- 1 | #define JEMALLOC_MANGLE 2 | #include "jemalloc_test.h" 3 | 4 | int 5 | main(void) 6 | { 7 | int ret, err; 8 | size_t sz, lg_chunk, chunksize, i; 9 | char *p, *q; 10 | 11 | malloc_printf("Test begin\n"); 12 | 13 | sz = sizeof(lg_chunk); 14 | if ((err = mallctl("opt.lg_chunk", &lg_chunk, &sz, NULL, 0))) { 15 | assert(err != ENOENT); 16 | malloc_printf("%s(): Error in mallctl(): %s\n", __func__, 17 | strerror(err)); 18 | ret = 1; 19 | goto label_return; 20 | } 21 | chunksize = ((size_t)1U) << lg_chunk; 22 | 23 | p = (char *)malloc(chunksize); 24 | if (p == NULL) { 25 | malloc_printf("malloc(%zu) --> %p\n", chunksize, p); 26 | ret = 1; 27 | goto label_return; 28 | } 29 | memset(p, 'a', chunksize); 30 | 31 | q = (char *)realloc(p, chunksize * 2); 32 | if (q == NULL) { 33 | malloc_printf("realloc(%p, %zu) --> %p\n", p, chunksize * 2, 34 | q); 35 | ret = 1; 36 | goto label_return; 37 | } 38 | for (i = 0; i < chunksize; i++) { 39 | assert(q[i] == 'a'); 40 | } 41 | 42 | p = q; 43 | 44 | q = (char *)realloc(p, chunksize); 45 | if (q == NULL) { 46 | malloc_printf("realloc(%p, %zu) --> %p\n", p, chunksize, q); 47 | ret = 1; 48 | goto label_return; 49 | } 50 | for (i = 0; i < chunksize; i++) { 51 | assert(q[i] == 'a'); 52 | } 53 | 54 | free(q); 55 | 56 | ret = 0; 57 | label_return: 58 | malloc_printf("Test end\n"); 59 | return (ret); 60 | } 61 | -------------------------------------------------------------------------------- /deps/jemalloc/test/mremap.exp: -------------------------------------------------------------------------------- 1 | Test begin 2 | Test end 3 | -------------------------------------------------------------------------------- /deps/jemalloc/test/posix_memalign.exp: -------------------------------------------------------------------------------- 1 | Test begin 2 | Alignment: 8 3 | Alignment: 16 4 | Alignment: 32 5 | Alignment: 64 6 | Alignment: 128 7 | Alignment: 256 8 | Alignment: 512 9 | Alignment: 1024 10 | Alignment: 2048 11 | Alignment: 4096 12 | Alignment: 8192 13 | Alignment: 16384 14 | Alignment: 32768 15 | Alignment: 65536 16 | Alignment: 131072 17 | Alignment: 262144 18 | Alignment: 524288 19 | Alignment: 1048576 20 | Alignment: 2097152 21 | Alignment: 4194304 22 | Alignment: 8388608 23 | Alignment: 16777216 24 | Alignment: 33554432 25 | Test end 26 | -------------------------------------------------------------------------------- /deps/jemalloc/test/rallocm.exp: -------------------------------------------------------------------------------- 1 | Test begin 2 | Test end 3 | -------------------------------------------------------------------------------- /deps/jemalloc/test/thread_arena.exp: -------------------------------------------------------------------------------- 1 | Test begin 2 | Test end 3 | -------------------------------------------------------------------------------- /deps/jemalloc/test/thread_tcache_enabled.exp: -------------------------------------------------------------------------------- 1 | Test begin 2 | Test end 3 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/.gitignore: -------------------------------------------------------------------------------- 1 | build_config.mk 2 | *.a 3 | *.o 4 | *.dylib* 5 | *.so 6 | *.so.* 7 | *_test 8 | db_bench 9 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name or Organization 3 | 4 | Google Inc. 5 | 6 | # Initial version authors: 7 | Jeffrey Dean 8 | Sanjay Ghemawat 9 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/NEWS: -------------------------------------------------------------------------------- 1 | Release 1.2 2011-05-16 2 | ---------------------- 3 | 4 | Fixes for larger databases (tested up to one billion 100-byte entries, 5 | i.e., ~100GB). 6 | 7 | (1) Place hard limit on number of level-0 files. This fixes errors 8 | of the form "too many open files". 9 | 10 | (2) Fixed memtable management. Before the fix, a heavy write burst 11 | could cause unbounded memory usage. 12 | 13 | A fix for a logging bug where the reader would incorrectly complain 14 | about corruption. 15 | 16 | Allow public access to WriteBatch contents so that users can easily 17 | wrap a DB. 18 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/TODO: -------------------------------------------------------------------------------- 1 | ss 2 | - Stats 3 | 4 | db 5 | - Maybe implement DB::BulkDeleteForRange(start_key, end_key) 6 | that would blow away files whose ranges are entirely contained 7 | within [start_key..end_key]? For Chrome, deletion of obsolete 8 | object stores, etc. can be done in the background anyway, so 9 | probably not that important. 10 | - There have been requests for MultiGet. 11 | 12 | After a range is completely deleted, what gets rid of the 13 | corresponding files if we do no future changes to that range. Make 14 | the conditions for triggering compactions fire in more situations? 15 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/db/builder.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_BUILDER_H_ 6 | #define STORAGE_LEVELDB_DB_BUILDER_H_ 7 | 8 | #include "leveldb/status.h" 9 | 10 | namespace leveldb { 11 | 12 | struct Options; 13 | struct FileMetaData; 14 | 15 | class Env; 16 | class Iterator; 17 | class TableCache; 18 | class VersionEdit; 19 | 20 | // Build a Table file from the contents of *iter. The generated file 21 | // will be named according to meta->number. On success, the rest of 22 | // *meta will be filled with metadata about the generated table. 23 | // If no data is present in *iter, meta->file_size will be set to 24 | // zero, and no Table file will be produced. 25 | extern Status BuildTable(const std::string& dbname, 26 | Env* env, 27 | const Options& options, 28 | TableCache* table_cache, 29 | Iterator* iter, 30 | FileMetaData* meta); 31 | 32 | } // namespace leveldb 33 | 34 | #endif // STORAGE_LEVELDB_DB_BUILDER_H_ 35 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/db/db_iter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_DB_ITER_H_ 6 | #define STORAGE_LEVELDB_DB_DB_ITER_H_ 7 | 8 | #include 9 | #include "leveldb/db.h" 10 | #include "db/dbformat.h" 11 | 12 | namespace leveldb { 13 | 14 | // Return a new iterator that converts internal keys (yielded by 15 | // "*internal_iter") that were live at the specified "sequence" number 16 | // into appropriate user keys. 17 | extern Iterator* NewDBIterator( 18 | const std::string* dbname, 19 | Env* env, 20 | const Comparator* user_key_comparator, 21 | Iterator* internal_iter, 22 | const SequenceNumber& sequence); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_DB_DB_ITER_H_ 27 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/db/log_format.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Log format information shared by reader and writer. 6 | // See ../doc/log_format.txt for more detail. 7 | 8 | #ifndef STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 9 | #define STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 10 | 11 | namespace leveldb { 12 | namespace log { 13 | 14 | enum RecordType { 15 | // Zero is reserved for preallocated files 16 | kZeroType = 0, 17 | 18 | kFullType = 1, 19 | 20 | // For fragments 21 | kFirstType = 2, 22 | kMiddleType = 3, 23 | kLastType = 4 24 | }; 25 | static const int kMaxRecordType = kLastType; 26 | 27 | static const int kBlockSize = 32768; 28 | 29 | // Header is checksum (4 bytes), type (1 byte), length (2 bytes). 30 | static const int kHeaderSize = 4 + 1 + 2; 31 | 32 | } // namespace log 33 | } // namespace leveldb 34 | 35 | #endif // STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 36 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/db/log_writer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_LOG_WRITER_H_ 6 | #define STORAGE_LEVELDB_DB_LOG_WRITER_H_ 7 | 8 | #include 9 | #include "db/log_format.h" 10 | #include "leveldb/slice.h" 11 | #include "leveldb/status.h" 12 | 13 | namespace leveldb { 14 | 15 | class WritableFile; 16 | 17 | namespace log { 18 | 19 | class Writer { 20 | public: 21 | // Create a writer that will append data to "*dest". 22 | // "*dest" must be initially empty. 23 | // "*dest" must remain live while this Writer is in use. 24 | explicit Writer(WritableFile* dest); 25 | ~Writer(); 26 | 27 | Status AddRecord(const Slice& slice); 28 | 29 | private: 30 | WritableFile* dest_; 31 | int block_offset_; // Current offset in block 32 | 33 | // crc32c values for all supported record types. These are 34 | // pre-computed to reduce the overhead of computing the crc of the 35 | // record type stored in the header. 36 | uint32_t type_crc_[kMaxRecordType + 1]; 37 | 38 | Status EmitPhysicalRecord(RecordType type, const char* ptr, size_t length); 39 | 40 | // No copying allowed 41 | Writer(const Writer&); 42 | void operator=(const Writer&); 43 | }; 44 | 45 | } // namespace log 46 | } // namespace leveldb 47 | 48 | #endif // STORAGE_LEVELDB_DB_LOG_WRITER_H_ 49 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/db/version_edit_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "db/version_edit.h" 6 | #include "util/testharness.h" 7 | 8 | namespace leveldb { 9 | 10 | static void TestEncodeDecode(const VersionEdit& edit) { 11 | std::string encoded, encoded2; 12 | edit.EncodeTo(&encoded); 13 | VersionEdit parsed; 14 | Status s = parsed.DecodeFrom(encoded); 15 | ASSERT_TRUE(s.ok()) << s.ToString(); 16 | parsed.EncodeTo(&encoded2); 17 | ASSERT_EQ(encoded, encoded2); 18 | } 19 | 20 | class VersionEditTest { }; 21 | 22 | TEST(VersionEditTest, EncodeDecode) { 23 | static const uint64_t kBig = 1ull << 50; 24 | 25 | VersionEdit edit; 26 | for (int i = 0; i < 4; i++) { 27 | TestEncodeDecode(edit); 28 | edit.AddFile(3, kBig + 300 + i, kBig + 400 + i, 29 | InternalKey("foo", kBig + 500 + i, kTypeValue), 30 | InternalKey("zoo", kBig + 600 + i, kTypeDeletion)); 31 | edit.DeleteFile(4, kBig + 700 + i); 32 | edit.SetCompactPointer(i, InternalKey("x", kBig + 900 + i, kTypeValue)); 33 | } 34 | 35 | edit.SetComparatorName("foo"); 36 | edit.SetLogNumber(kBig + 100); 37 | edit.SetNextFile(kBig + 200); 38 | edit.SetLastSequence(kBig + 1000); 39 | TestEncodeDecode(edit); 40 | } 41 | 42 | } // namespace leveldb 43 | 44 | int main(int argc, char** argv) { 45 | return leveldb::test::RunAllTests(); 46 | } 47 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/db/write_batch_internal.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ 6 | #define STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ 7 | 8 | #include "leveldb/write_batch.h" 9 | 10 | namespace leveldb { 11 | 12 | class MemTable; 13 | 14 | // WriteBatchInternal provides static methods for manipulating a 15 | // WriteBatch that we don't want in the public WriteBatch interface. 16 | class WriteBatchInternal { 17 | public: 18 | // Return the number of entries in the batch. 19 | static int Count(const WriteBatch* batch); 20 | 21 | // Set the count for the number of entries in the batch. 22 | static void SetCount(WriteBatch* batch, int n); 23 | 24 | // Return the seqeunce number for the start of this batch. 25 | static SequenceNumber Sequence(const WriteBatch* batch); 26 | 27 | // Store the specified number as the seqeunce number for the start of 28 | // this batch. 29 | static void SetSequence(WriteBatch* batch, SequenceNumber seq); 30 | 31 | static Slice Contents(const WriteBatch* batch) { 32 | return Slice(batch->rep_); 33 | } 34 | 35 | static size_t ByteSize(const WriteBatch* batch) { 36 | return batch->rep_.size(); 37 | } 38 | 39 | static void SetContents(WriteBatch* batch, const Slice& contents); 40 | 41 | static Status InsertInto(const WriteBatch* batch, MemTable* memtable); 42 | 43 | static void Append(WriteBatch* dst, const WriteBatch* src); 44 | }; 45 | 46 | } // namespace leveldb 47 | 48 | 49 | #endif // STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ 50 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/doc/doc.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-left: 0.5in; 3 | margin-right: 0.5in; 4 | background: white; 5 | color: black; 6 | } 7 | 8 | h1 { 9 | margin-left: -0.2in; 10 | font-size: 14pt; 11 | } 12 | h2 { 13 | margin-left: -0in; 14 | font-size: 12pt; 15 | } 16 | h3 { 17 | margin-left: -0in; 18 | } 19 | h4 { 20 | margin-left: -0in; 21 | } 22 | hr { 23 | margin-left: -0in; 24 | } 25 | 26 | /* Definition lists: definition term bold */ 27 | dt { 28 | font-weight: bold; 29 | } 30 | 31 | address { 32 | text-align: center; 33 | } 34 | code,samp,var { 35 | color: blue; 36 | } 37 | kbd { 38 | color: #600000; 39 | } 40 | div.note p { 41 | float: right; 42 | width: 3in; 43 | margin-right: 0%; 44 | padding: 1px; 45 | border: 2px solid #6060a0; 46 | background-color: #fffff0; 47 | } 48 | 49 | ul { 50 | margin-top: -0em; 51 | margin-bottom: -0em; 52 | } 53 | 54 | ol { 55 | margin-top: -0em; 56 | margin-bottom: -0em; 57 | } 58 | 59 | UL.nobullets { 60 | list-style-type: none; 61 | list-style-image: none; 62 | margin-left: -1em; 63 | } 64 | 65 | p { 66 | margin: 1em 0 1em 0; 67 | padding: 0 0 0 0; 68 | } 69 | 70 | pre { 71 | line-height: 1.3em; 72 | padding: 0.4em 0 0.8em 0; 73 | margin: 0 0 0 0; 74 | border: 0 0 0 0; 75 | color: blue; 76 | } 77 | 78 | .datatable { 79 | margin-left: auto; 80 | margin-right: auto; 81 | margin-top: 2em; 82 | margin-bottom: 2em; 83 | border: 1px solid; 84 | } 85 | 86 | .datatable td,th { 87 | padding: 0 0.5em 0 0.5em; 88 | text-align: right; 89 | } 90 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/helpers/memenv/memenv.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 6 | #define STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Env; 11 | 12 | // Returns a new environment that stores its data in memory and delegates 13 | // all non-file-storage tasks to base_env. The caller must delete the result 14 | // when it is no longer needed. 15 | // *base_env must remain live while the result is in use. 16 | Env* NewMemEnv(Env* base_env); 17 | 18 | } // namespace leveldb 19 | 20 | #endif // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 21 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/port/README: -------------------------------------------------------------------------------- 1 | This directory contains interfaces and implementations that isolate the 2 | rest of the package from platform details. 3 | 4 | Code in the rest of the package includes "port.h" from this directory. 5 | "port.h" in turn includes a platform specific "port_.h" file 6 | that provides the platform specific implementation. 7 | 8 | See port_posix.h for an example of what must be provided in a platform 9 | specific header file. 10 | 11 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/port/port.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_PORT_PORT_H_ 6 | #define STORAGE_LEVELDB_PORT_PORT_H_ 7 | 8 | #include 9 | 10 | // Include the appropriate platform specific file below. If you are 11 | // porting to a new platform, see "port_example.h" for documentation 12 | // of what the new port_.h file must provide. 13 | #if defined(LEVELDB_PLATFORM_POSIX) 14 | # include "port/port_posix.h" 15 | #elif defined(LEVELDB_PLATFORM_CHROMIUM) 16 | # include "port/port_chromium.h" 17 | #endif 18 | 19 | #endif // STORAGE_LEVELDB_PORT_PORT_H_ 20 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/port/port_posix.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "port/port_posix.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include "util/logging.h" 11 | 12 | namespace leveldb { 13 | namespace port { 14 | 15 | static void PthreadCall(const char* label, int result) { 16 | if (result != 0) { 17 | fprintf(stderr, "pthread %s: %s\n", label, strerror(result)); 18 | abort(); 19 | } 20 | } 21 | 22 | Mutex::Mutex() { PthreadCall("init mutex", pthread_mutex_init(&mu_, NULL)); } 23 | 24 | Mutex::~Mutex() { PthreadCall("destroy mutex", pthread_mutex_destroy(&mu_)); } 25 | 26 | void Mutex::Lock() { PthreadCall("lock", pthread_mutex_lock(&mu_)); } 27 | 28 | void Mutex::Unlock() { PthreadCall("unlock", pthread_mutex_unlock(&mu_)); } 29 | 30 | CondVar::CondVar(Mutex* mu) 31 | : mu_(mu) { 32 | PthreadCall("init cv", pthread_cond_init(&cv_, NULL)); 33 | } 34 | 35 | CondVar::~CondVar() { PthreadCall("destroy cv", pthread_cond_destroy(&cv_)); } 36 | 37 | void CondVar::Wait() { 38 | PthreadCall("wait", pthread_cond_wait(&cv_, &mu_->mu_)); 39 | } 40 | 41 | void CondVar::Signal() { 42 | PthreadCall("signal", pthread_cond_signal(&cv_)); 43 | } 44 | 45 | void CondVar::SignalAll() { 46 | PthreadCall("broadcast", pthread_cond_broadcast(&cv_)); 47 | } 48 | 49 | void InitOnce(OnceType* once, void (*initializer)()) { 50 | PthreadCall("once", pthread_once(once, initializer)); 51 | } 52 | 53 | } // namespace port 54 | } // namespace leveldb 55 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/port/thread_annotations.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H 6 | 7 | // Some environments provide custom macros to aid in static thread-safety 8 | // analysis. Provide empty definitions of such macros unless they are already 9 | // defined. 10 | 11 | #ifndef EXCLUSIVE_LOCKS_REQUIRED 12 | #define EXCLUSIVE_LOCKS_REQUIRED(...) 13 | #endif 14 | 15 | #ifndef SHARED_LOCKS_REQUIRED 16 | #define SHARED_LOCKS_REQUIRED(...) 17 | #endif 18 | 19 | #ifndef LOCKS_EXCLUDED 20 | #define LOCKS_EXCLUDED(...) 21 | #endif 22 | 23 | #ifndef LOCK_RETURNED 24 | #define LOCK_RETURNED(x) 25 | #endif 26 | 27 | #ifndef LOCKABLE 28 | #define LOCKABLE 29 | #endif 30 | 31 | #ifndef SCOPED_LOCKABLE 32 | #define SCOPED_LOCKABLE 33 | #endif 34 | 35 | #ifndef EXCLUSIVE_LOCK_FUNCTION 36 | #define EXCLUSIVE_LOCK_FUNCTION(...) 37 | #endif 38 | 39 | #ifndef SHARED_LOCK_FUNCTION 40 | #define SHARED_LOCK_FUNCTION(...) 41 | #endif 42 | 43 | #ifndef EXCLUSIVE_TRYLOCK_FUNCTION 44 | #define EXCLUSIVE_TRYLOCK_FUNCTION(...) 45 | #endif 46 | 47 | #ifndef SHARED_TRYLOCK_FUNCTION 48 | #define SHARED_TRYLOCK_FUNCTION(...) 49 | #endif 50 | 51 | #ifndef UNLOCK_FUNCTION 52 | #define UNLOCK_FUNCTION(...) 53 | #endif 54 | 55 | #ifndef NO_THREAD_SAFETY_ANALYSIS 56 | #define NO_THREAD_SAFETY_ANALYSIS 57 | #endif 58 | 59 | #endif // STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H 60 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/port/win/stdint.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | // MSVC didn't ship with this file until the 2010 version. 6 | 7 | #ifndef STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 8 | #define STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 9 | 10 | #if !defined(_MSC_VER) 11 | #error This file should only be included when compiling with MSVC. 12 | #endif 13 | 14 | // Define C99 equivalent types. 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | typedef unsigned char uint8_t; 20 | typedef unsigned short uint16_t; 21 | typedef unsigned int uint32_t; 22 | typedef unsigned long long uint64_t; 23 | 24 | #endif // STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 25 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/table/block.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_ 6 | #define STORAGE_LEVELDB_TABLE_BLOCK_H_ 7 | 8 | #include 9 | #include 10 | #include "leveldb/iterator.h" 11 | 12 | namespace leveldb { 13 | 14 | struct BlockContents; 15 | class Comparator; 16 | 17 | class Block { 18 | public: 19 | // Initialize the block with the specified contents. 20 | explicit Block(const BlockContents& contents); 21 | 22 | ~Block(); 23 | 24 | size_t size() const { return size_; } 25 | Iterator* NewIterator(const Comparator* comparator); 26 | 27 | private: 28 | uint32_t NumRestarts() const; 29 | 30 | const char* data_; 31 | size_t size_; 32 | uint32_t restart_offset_; // Offset in data_ of restart array 33 | bool owned_; // Block owns data_[] 34 | 35 | // No copying allowed 36 | Block(const Block&); 37 | void operator=(const Block&); 38 | 39 | class Iter; 40 | }; 41 | 42 | } // namespace leveldb 43 | 44 | #endif // STORAGE_LEVELDB_TABLE_BLOCK_H_ 45 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/table/merger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_MERGER_H_ 6 | #define STORAGE_LEVELDB_TABLE_MERGER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Comparator; 11 | class Iterator; 12 | 13 | // Return an iterator that provided the union of the data in 14 | // children[0,n-1]. Takes ownership of the child iterators and 15 | // will delete them when the result iterator is deleted. 16 | // 17 | // The result does no duplicate suppression. I.e., if a particular 18 | // key is present in K child iterators, it will be yielded K times. 19 | // 20 | // REQUIRES: n >= 0 21 | extern Iterator* NewMergingIterator( 22 | const Comparator* comparator, Iterator** children, int n); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_TABLE_MERGER_H_ 27 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/table/two_level_iterator.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 6 | #define STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 7 | 8 | #include "leveldb/iterator.h" 9 | 10 | namespace leveldb { 11 | 12 | struct ReadOptions; 13 | 14 | // Return a new two level iterator. A two-level iterator contains an 15 | // index iterator whose values point to a sequence of blocks where 16 | // each block is itself a sequence of key,value pairs. The returned 17 | // two-level iterator yields the concatenation of all key/value pairs 18 | // in the sequence of blocks. Takes ownership of "index_iter" and 19 | // will delete it when no longer needed. 20 | // 21 | // Uses a supplied function to convert an index_iter value into 22 | // an iterator over the contents of the corresponding block. 23 | extern Iterator* NewTwoLevelIterator( 24 | Iterator* index_iter, 25 | Iterator* (*block_function)( 26 | void* arg, 27 | const ReadOptions& options, 28 | const Slice& index_value), 29 | void* arg, 30 | const ReadOptions& options); 31 | 32 | } // namespace leveldb 33 | 34 | #endif // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 35 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/util/crc32c.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_CRC32C_H_ 6 | #define STORAGE_LEVELDB_UTIL_CRC32C_H_ 7 | 8 | #include 9 | #include 10 | 11 | namespace leveldb { 12 | namespace crc32c { 13 | 14 | // Return the crc32c of concat(A, data[0,n-1]) where init_crc is the 15 | // crc32c of some string A. Extend() is often used to maintain the 16 | // crc32c of a stream of data. 17 | extern uint32_t Extend(uint32_t init_crc, const char* data, size_t n); 18 | 19 | // Return the crc32c of data[0,n-1] 20 | inline uint32_t Value(const char* data, size_t n) { 21 | return Extend(0, data, n); 22 | } 23 | 24 | static const uint32_t kMaskDelta = 0xa282ead8ul; 25 | 26 | // Return a masked representation of crc. 27 | // 28 | // Motivation: it is problematic to compute the CRC of a string that 29 | // contains embedded CRCs. Therefore we recommend that CRCs stored 30 | // somewhere (e.g., in files) should be masked before being stored. 31 | inline uint32_t Mask(uint32_t crc) { 32 | // Rotate right by 15 bits and add a constant. 33 | return ((crc >> 15) | (crc << 17)) + kMaskDelta; 34 | } 35 | 36 | // Return the crc whose masked representation is masked_crc. 37 | inline uint32_t Unmask(uint32_t masked_crc) { 38 | uint32_t rot = masked_crc - kMaskDelta; 39 | return ((rot >> 17) | (rot << 15)); 40 | } 41 | 42 | } // namespace crc32c 43 | } // namespace leveldb 44 | 45 | #endif // STORAGE_LEVELDB_UTIL_CRC32C_H_ 46 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/util/filter_policy.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/filter_policy.h" 6 | 7 | namespace leveldb { 8 | 9 | FilterPolicy::~FilterPolicy() { } 10 | 11 | } // namespace leveldb 12 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/util/hash.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include 6 | #include "util/coding.h" 7 | #include "util/hash.h" 8 | 9 | // The FALLTHROUGH_INTENDED macro can be used to annotate implicit fall-through 10 | // between switch labels. The real definition should be provided externally. 11 | // This one is a fallback version for unsupported compilers. 12 | #ifndef FALLTHROUGH_INTENDED 13 | #define FALLTHROUGH_INTENDED do { } while (0) 14 | #endif 15 | 16 | namespace leveldb { 17 | 18 | uint32_t Hash(const char* data, size_t n, uint32_t seed) { 19 | // Similar to murmur hash 20 | const uint32_t m = 0xc6a4a793; 21 | const uint32_t r = 24; 22 | const char* limit = data + n; 23 | uint32_t h = seed ^ (n * m); 24 | 25 | // Pick up four bytes at a time 26 | while (data + 4 <= limit) { 27 | uint32_t w = DecodeFixed32(data); 28 | data += 4; 29 | h += w; 30 | h *= m; 31 | h ^= (h >> 16); 32 | } 33 | 34 | // Pick up remaining bytes 35 | switch (limit - data) { 36 | case 3: 37 | h += data[2] << 16; 38 | FALLTHROUGH_INTENDED; 39 | case 2: 40 | h += data[1] << 8; 41 | FALLTHROUGH_INTENDED; 42 | case 1: 43 | h += data[0]; 44 | h *= m; 45 | h ^= (h >> r); 46 | break; 47 | } 48 | return h; 49 | } 50 | 51 | 52 | } // namespace leveldb 53 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/util/hash.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Simple hash function used for internal data structures 6 | 7 | #ifndef STORAGE_LEVELDB_UTIL_HASH_H_ 8 | #define STORAGE_LEVELDB_UTIL_HASH_H_ 9 | 10 | #include 11 | #include 12 | 13 | namespace leveldb { 14 | 15 | extern uint32_t Hash(const char* data, size_t n, uint32_t seed); 16 | 17 | } 18 | 19 | #endif // STORAGE_LEVELDB_UTIL_HASH_H_ 20 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/util/histogram.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 6 | #define STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 7 | 8 | #include 9 | 10 | namespace leveldb { 11 | 12 | class Histogram { 13 | public: 14 | Histogram() { } 15 | ~Histogram() { } 16 | 17 | void Clear(); 18 | void Add(double value); 19 | void Merge(const Histogram& other); 20 | 21 | std::string ToString() const; 22 | 23 | private: 24 | double min_; 25 | double max_; 26 | double num_; 27 | double sum_; 28 | double sum_squares_; 29 | 30 | enum { kNumBuckets = 154 }; 31 | static const double kBucketLimit[kNumBuckets]; 32 | double buckets_[kNumBuckets]; 33 | 34 | double Median() const; 35 | double Percentile(double p) const; 36 | double Average() const; 37 | double StandardDeviation() const; 38 | }; 39 | 40 | } // namespace leveldb 41 | 42 | #endif // STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 43 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/util/logging.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Must not be included from any .h files to avoid polluting the namespace 6 | // with macros. 7 | 8 | #ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_ 9 | #define STORAGE_LEVELDB_UTIL_LOGGING_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | #include "port/port.h" 15 | 16 | namespace leveldb { 17 | 18 | class Slice; 19 | class WritableFile; 20 | 21 | // Append a human-readable printout of "num" to *str 22 | extern void AppendNumberTo(std::string* str, uint64_t num); 23 | 24 | // Append a human-readable printout of "value" to *str. 25 | // Escapes any non-printable characters found in "value". 26 | extern void AppendEscapedStringTo(std::string* str, const Slice& value); 27 | 28 | // Return a human-readable printout of "num" 29 | extern std::string NumberToString(uint64_t num); 30 | 31 | // Return a human-readable version of "value". 32 | // Escapes any non-printable characters found in "value". 33 | extern std::string EscapeString(const Slice& value); 34 | 35 | // If *in starts with "c", advances *in past the first character and 36 | // returns true. Otherwise, returns false. 37 | extern bool ConsumeChar(Slice* in, char c); 38 | 39 | // Parse a human-readable number from "*in" into *value. On success, 40 | // advances "*in" past the consumed number and sets "*val" to the 41 | // numeric value. Otherwise, returns false and leaves *in in an 42 | // unspecified state. 43 | extern bool ConsumeDecimalNumber(Slice* in, uint64_t* val); 44 | 45 | } // namespace leveldb 46 | 47 | #endif // STORAGE_LEVELDB_UTIL_LOGGING_H_ 48 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/util/mutexlock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 6 | #define STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 7 | 8 | #include "port/port.h" 9 | #include "port/thread_annotations.h" 10 | 11 | namespace leveldb { 12 | 13 | // Helper class that locks a mutex on construction and unlocks the mutex when 14 | // the destructor of the MutexLock object is invoked. 15 | // 16 | // Typical usage: 17 | // 18 | // void MyClass::MyMethod() { 19 | // MutexLock l(&mu_); // mu_ is an instance variable 20 | // ... some complex code, possibly with multiple return paths ... 21 | // } 22 | 23 | class SCOPED_LOCKABLE MutexLock { 24 | public: 25 | explicit MutexLock(port::Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) 26 | : mu_(mu) { 27 | this->mu_->Lock(); 28 | } 29 | ~MutexLock() UNLOCK_FUNCTION() { this->mu_->Unlock(); } 30 | 31 | private: 32 | port::Mutex *const mu_; 33 | // No copying allowed 34 | MutexLock(const MutexLock&); 35 | void operator=(const MutexLock&); 36 | }; 37 | 38 | } // namespace leveldb 39 | 40 | 41 | #endif // STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 42 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/util/options.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/options.h" 6 | 7 | #include "leveldb/comparator.h" 8 | #include "leveldb/env.h" 9 | 10 | namespace leveldb { 11 | 12 | Options::Options() 13 | : comparator(BytewiseComparator()), 14 | create_if_missing(false), 15 | error_if_exists(false), 16 | paranoid_checks(false), 17 | env(Env::Default()), 18 | info_log(NULL), 19 | write_buffer_size(4<<20), 20 | max_open_files(1000), 21 | block_cache(NULL), 22 | block_size(4096), 23 | block_restart_interval(16), 24 | compression(kSnappyCompression), 25 | filter_policy(NULL) { 26 | } 27 | 28 | 29 | } // namespace leveldb 30 | -------------------------------------------------------------------------------- /deps/leveldb-1.10.0/util/testutil.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/testutil.h" 6 | 7 | #include "util/random.h" 8 | 9 | namespace leveldb { 10 | namespace test { 11 | 12 | Slice RandomString(Random* rnd, int len, std::string* dst) { 13 | dst->resize(len); 14 | for (int i = 0; i < len; i++) { 15 | (*dst)[i] = static_cast(' ' + rnd->Uniform(95)); // ' ' .. '~' 16 | } 17 | return Slice(*dst); 18 | } 19 | 20 | std::string RandomKey(Random* rnd, int len) { 21 | // Make sure to generate a wide variety of characters so we 22 | // test the boundary conditions for short-key optimizations. 23 | static const char kTestChars[] = { 24 | '\0', '\1', 'a', 'b', 'c', 'd', 'e', '\xfd', '\xfe', '\xff' 25 | }; 26 | std::string result; 27 | for (int i = 0; i < len; i++) { 28 | result += kTestChars[rnd->Uniform(sizeof(kTestChars))]; 29 | } 30 | return result; 31 | } 32 | 33 | 34 | extern Slice CompressibleString(Random* rnd, double compressed_fraction, 35 | int len, std::string* dst) { 36 | int raw = static_cast(len * compressed_fraction); 37 | if (raw < 1) raw = 1; 38 | std::string raw_data; 39 | RandomString(rnd, raw, &raw_data); 40 | 41 | // Duplicate the random data until we have filled "len" bytes 42 | dst->clear(); 43 | while (dst->size() < len) { 44 | dst->append(raw_data); 45 | } 46 | dst->resize(len); 47 | return Slice(*dst); 48 | } 49 | 50 | } // namespace test 51 | } // namespace leveldb 52 | -------------------------------------------------------------------------------- /deps/linenoise/.gitignore: -------------------------------------------------------------------------------- 1 | linenoise_example* 2 | -------------------------------------------------------------------------------- /deps/linenoise/Makefile: -------------------------------------------------------------------------------- 1 | STD= 2 | WARN= -Wall 3 | OPT= -Os 4 | 5 | R_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) 6 | R_LDFLAGS= $(LDFLAGS) 7 | DEBUG= -g 8 | 9 | R_CC=$(CC) $(R_CFLAGS) 10 | R_LD=$(CC) $(R_LDFLAGS) 11 | 12 | linenoise.o: linenoise.h linenoise.c 13 | 14 | linenoise_example: linenoise.o example.o 15 | $(R_LD) -o $@ $^ 16 | 17 | .c.o: 18 | $(R_CC) -c $< 19 | 20 | clean: 21 | rm -f linenoise_example *.o 22 | -------------------------------------------------------------------------------- /deps/linenoise/example.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "linenoise.h" 4 | 5 | 6 | void completion(const char *buf, linenoiseCompletions *lc) { 7 | if (buf[0] == 'h') { 8 | linenoiseAddCompletion(lc,"hello"); 9 | linenoiseAddCompletion(lc,"hello there"); 10 | } 11 | } 12 | 13 | int main(void) { 14 | char *line; 15 | 16 | linenoiseSetCompletionCallback(completion); 17 | linenoiseHistoryLoad("history.txt"); /* Load the history at startup */ 18 | while((line = linenoise("hello> ")) != NULL) { 19 | if (line[0] != '\0') { 20 | printf("echo: '%s'\n", line); 21 | linenoiseHistoryAdd(line); 22 | linenoiseHistorySave("history.txt"); /* Save every new entry */ 23 | } 24 | free(line); 25 | } 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /deps/lua/README: -------------------------------------------------------------------------------- 1 | README for LuaJIT 2.0.0 2 | ----------------------- 3 | 4 | LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. 5 | 6 | Project Homepage: http://luajit.org/ 7 | 8 | LuaJIT is Copyright (C) 2005-2012 Mike Pall. 9 | LuaJIT is free software, released under the MIT license. 10 | See full Copyright Notice in the COPYRIGHT file or in luajit.h. 11 | 12 | Documentation for LuaJIT is available in HTML format. 13 | Please point your favorite browser to: 14 | 15 | doc/luajit.html 16 | 17 | -------------------------------------------------------------------------------- /deps/lua/doc/img/contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/lua/doc/img/contact.png -------------------------------------------------------------------------------- /deps/lua/dynasm/dasm_x64.lua: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- DynASM x64 module. 3 | -- 4 | -- Copyright (C) 2005-2012 Mike Pall. All rights reserved. 5 | -- See dynasm.lua for full copyright notice. 6 | ------------------------------------------------------------------------------ 7 | -- This module just sets 64 bit mode for the combined x86/x64 module. 8 | -- All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | x64 = true -- Using a global is an ugly, but effective solution. 12 | return require("dasm_x86") 13 | -------------------------------------------------------------------------------- /deps/lua/etc/luajit.pc: -------------------------------------------------------------------------------- 1 | # Package information for LuaJIT to be used by pkg-config. 2 | majver=2 3 | minver=0 4 | relver=0 5 | version=${majver}.${minver}.${relver} 6 | abiver=5.1 7 | 8 | prefix=/usr/local 9 | exec_prefix=${prefix} 10 | libdir=${exec_prefix}/lib 11 | libname=luajit-${abiver} 12 | includedir=${prefix}/include/luajit-${majver}.${minver} 13 | 14 | INSTALL_LMOD=${prefix}/share/lua/${abiver} 15 | INSTALL_CMOD=${prefix}/lib/lua/${abiver} 16 | 17 | Name: LuaJIT 18 | Description: Just-in-time compiler for Lua 19 | URL: http://luajit.org 20 | Version: ${version} 21 | Requires: 22 | Libs: -L${libdir} -l${libname} 23 | Libs.private: -Wl,-E -lm -ldl 24 | Cflags: -I${includedir} 25 | -------------------------------------------------------------------------------- /deps/lua/src/host/README: -------------------------------------------------------------------------------- 1 | The files in this directory are only used during the build process of LuaJIT. 2 | For cross-compilation, they must be executed on the host, not on the target. 3 | 4 | These files should NOT be installed! 5 | -------------------------------------------------------------------------------- /deps/lua/src/jit/dis_mipsel.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT MIPSEL disassembler wrapper module. 3 | -- 4 | -- Copyright (C) 2005-2011 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- This module just exports the little-endian functions from the 8 | -- MIPS disassembler module. All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | local require = require 12 | 13 | module(...) 14 | 15 | local dis_mips = require(_PACKAGE.."dis_mips") 16 | 17 | create = dis_mips.create_el 18 | disass = dis_mips.disass_el 19 | regname = dis_mips.regname 20 | 21 | -------------------------------------------------------------------------------- /deps/lua/src/jit/dis_x64.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT x64 disassembler wrapper module. 3 | -- 4 | -- Copyright (C) 2005-2012 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- This module just exports the 64 bit functions from the combined 8 | -- x86/x64 disassembler module. All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | local require = require 12 | 13 | module(...) 14 | 15 | local dis_x86 = require(_PACKAGE.."dis_x86") 16 | 17 | create = dis_x86.create64 18 | disass = dis_x86.disass64 19 | regname = dis_x86.regname64 20 | 21 | -------------------------------------------------------------------------------- /deps/lua/src/lib_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Library initialization. 3 | ** Major parts taken verbatim from the Lua interpreter. 4 | ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h 5 | */ 6 | 7 | #define lib_init_c 8 | #define LUA_LIB 9 | 10 | #include "lua.h" 11 | #include "lauxlib.h" 12 | #include "lualib.h" 13 | 14 | #include "lj_arch.h" 15 | 16 | static const luaL_Reg lj_lib_load[] = { 17 | { "", luaopen_base }, 18 | { LUA_LOADLIBNAME, luaopen_package }, 19 | { LUA_TABLIBNAME, luaopen_table }, 20 | { LUA_IOLIBNAME, luaopen_io }, 21 | { LUA_OSLIBNAME, luaopen_os }, 22 | { LUA_STRLIBNAME, luaopen_string }, 23 | { LUA_MATHLIBNAME, luaopen_math }, 24 | { LUA_DBLIBNAME, luaopen_debug }, 25 | { LUA_BITLIBNAME, luaopen_bit }, 26 | { LUA_JITLIBNAME, luaopen_jit }, 27 | { NULL, NULL } 28 | }; 29 | 30 | static const luaL_Reg lj_lib_preload[] = { 31 | #if LJ_HASFFI 32 | { LUA_FFILIBNAME, luaopen_ffi }, 33 | #endif 34 | { NULL, NULL } 35 | }; 36 | 37 | LUALIB_API void luaL_openlibs(lua_State *L) 38 | { 39 | const luaL_Reg *lib; 40 | for (lib = lj_lib_load; lib->func; lib++) { 41 | lua_pushcfunction(L, lib->func); 42 | lua_pushstring(L, lib->name); 43 | lua_call(L, 1, 0); 44 | } 45 | luaL_findtable(L, LUA_REGISTRYINDEX, "_PRELOAD", 46 | sizeof(lj_lib_preload)/sizeof(lj_lib_preload[0])-1); 47 | for (lib = lj_lib_preload; lib->func; lib++) { 48 | lua_pushcfunction(L, lib->func); 49 | lua_setfield(L, -2, lib->name); 50 | } 51 | lua_pop(L, 1); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /deps/lua/src/lj.supp: -------------------------------------------------------------------------------- 1 | # Valgrind suppression file for LuaJIT 2.0. 2 | { 3 | Optimized string compare 4 | Memcheck:Addr4 5 | fun:lj_str_cmp 6 | } 7 | { 8 | Optimized string compare 9 | Memcheck:Addr1 10 | fun:lj_str_cmp 11 | } 12 | { 13 | Optimized string compare 14 | Memcheck:Addr4 15 | fun:lj_str_new 16 | } 17 | { 18 | Optimized string compare 19 | Memcheck:Addr1 20 | fun:lj_str_new 21 | } 22 | { 23 | Optimized string compare 24 | Memcheck:Cond 25 | fun:lj_str_new 26 | } 27 | -------------------------------------------------------------------------------- /deps/lua/src/lj_alloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Bundled memory allocator. 3 | ** Donated to the public domain. 4 | */ 5 | 6 | #ifndef _LJ_ALLOC_H 7 | #define _LJ_ALLOC_H 8 | 9 | #include "lj_def.h" 10 | 11 | #ifndef LUAJIT_USE_SYSMALLOC 12 | LJ_FUNC void *lj_alloc_create(void); 13 | LJ_FUNC void lj_alloc_destroy(void *msp); 14 | LJ_FUNC void *lj_alloc_f(void *msp, void *ptr, size_t osize, size_t nsize); 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /deps/lua/src/lj_asm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** IR assembler (SSA IR -> machine code). 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_ASM_H 7 | #define _LJ_ASM_H 8 | 9 | #include "lj_jit.h" 10 | 11 | #if LJ_HASJIT 12 | LJ_FUNC void lj_asm_trace(jit_State *J, GCtrace *T); 13 | LJ_FUNC void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, 14 | MCode *target); 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /deps/lua/src/lj_bc.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Bytecode instruction modes. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_bc_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | #include "lj_bc.h" 11 | 12 | /* Bytecode offsets and bytecode instruction modes. */ 13 | #include "lj_bcdef.h" 14 | 15 | -------------------------------------------------------------------------------- /deps/lua/src/lj_carith.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** C data arithmetic. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CARITH_H 7 | #define _LJ_CARITH_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASFFI 12 | 13 | LJ_FUNC int lj_carith_op(lua_State *L, MMS mm); 14 | 15 | #if LJ_32 && LJ_HASJIT 16 | LJ_FUNC int64_t lj_carith_mul64(int64_t x, int64_t k); 17 | #endif 18 | LJ_FUNC uint64_t lj_carith_divu64(uint64_t a, uint64_t b); 19 | LJ_FUNC int64_t lj_carith_divi64(int64_t a, int64_t b); 20 | LJ_FUNC uint64_t lj_carith_modu64(uint64_t a, uint64_t b); 21 | LJ_FUNC int64_t lj_carith_modi64(int64_t a, int64_t b); 22 | LJ_FUNC uint64_t lj_carith_powu64(uint64_t x, uint64_t k); 23 | LJ_FUNC int64_t lj_carith_powi64(int64_t x, int64_t k); 24 | 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /deps/lua/src/lj_ccallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** FFI C callback handling. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CCALLBACK_H 7 | #define _LJ_CCALLBACK_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_ctype.h" 11 | 12 | #if LJ_HASFFI 13 | 14 | /* Really belongs to lj_vm.h. */ 15 | LJ_ASMF void lj_vm_ffi_callback(void); 16 | 17 | LJ_FUNC MSize lj_ccallback_ptr2slot(CTState *cts, void *p); 18 | LJ_FUNCA lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf); 19 | LJ_FUNCA void LJ_FASTCALL lj_ccallback_leave(CTState *cts, TValue *o); 20 | LJ_FUNC void *lj_ccallback_new(CTState *cts, CType *ct, GCfunc *fn); 21 | LJ_FUNC void lj_ccallback_mcode_free(CTState *cts); 22 | 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /deps/lua/src/lj_char.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Character types. 3 | ** Donated to the public domain. 4 | */ 5 | 6 | #ifndef _LJ_CHAR_H 7 | #define _LJ_CHAR_H 8 | 9 | #include "lj_def.h" 10 | 11 | #define LJ_CHAR_CNTRL 0x01 12 | #define LJ_CHAR_SPACE 0x02 13 | #define LJ_CHAR_PUNCT 0x04 14 | #define LJ_CHAR_DIGIT 0x08 15 | #define LJ_CHAR_XDIGIT 0x10 16 | #define LJ_CHAR_UPPER 0x20 17 | #define LJ_CHAR_LOWER 0x40 18 | #define LJ_CHAR_IDENT 0x80 19 | #define LJ_CHAR_ALPHA (LJ_CHAR_LOWER|LJ_CHAR_UPPER) 20 | #define LJ_CHAR_ALNUM (LJ_CHAR_ALPHA|LJ_CHAR_DIGIT) 21 | #define LJ_CHAR_GRAPH (LJ_CHAR_ALNUM|LJ_CHAR_PUNCT) 22 | 23 | /* Only pass -1 or 0..255 to these macros. Never pass a signed char! */ 24 | #define lj_char_isa(c, t) ((lj_char_bits+1)[(c)] & t) 25 | #define lj_char_iscntrl(c) lj_char_isa((c), LJ_CHAR_CNTRL) 26 | #define lj_char_isspace(c) lj_char_isa((c), LJ_CHAR_SPACE) 27 | #define lj_char_ispunct(c) lj_char_isa((c), LJ_CHAR_PUNCT) 28 | #define lj_char_isdigit(c) lj_char_isa((c), LJ_CHAR_DIGIT) 29 | #define lj_char_isxdigit(c) lj_char_isa((c), LJ_CHAR_XDIGIT) 30 | #define lj_char_isupper(c) lj_char_isa((c), LJ_CHAR_UPPER) 31 | #define lj_char_islower(c) lj_char_isa((c), LJ_CHAR_LOWER) 32 | #define lj_char_isident(c) lj_char_isa((c), LJ_CHAR_IDENT) 33 | #define lj_char_isalpha(c) lj_char_isa((c), LJ_CHAR_ALPHA) 34 | #define lj_char_isalnum(c) lj_char_isa((c), LJ_CHAR_ALNUM) 35 | #define lj_char_isgraph(c) lj_char_isa((c), LJ_CHAR_GRAPH) 36 | 37 | #define lj_char_toupper(c) ((c) - (lj_char_islower(c) >> 1)) 38 | #define lj_char_tolower(c) ((c) + lj_char_isupper(c)) 39 | 40 | LJ_DATA const uint8_t lj_char_bits[257]; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /deps/lua/src/lj_clib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** FFI C library loader. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CLIB_H 7 | #define _LJ_CLIB_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASFFI 12 | 13 | /* Namespace for C library indexing. */ 14 | #define CLNS_INDEX ((1u<env. */ 20 | } CLibrary; 21 | 22 | LJ_FUNC TValue *lj_clib_index(lua_State *L, CLibrary *cl, GCstr *name); 23 | LJ_FUNC void lj_clib_load(lua_State *L, GCtab *mt, GCstr *name, int global); 24 | LJ_FUNC void lj_clib_unload(CLibrary *cl); 25 | LJ_FUNC void lj_clib_default(lua_State *L, GCtab *mt); 26 | 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /deps/lua/src/lj_crecord.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace recorder for C data operations. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CRECORD_H 7 | #define _LJ_CRECORD_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | #include "lj_ffrecord.h" 12 | 13 | #if LJ_HASJIT && LJ_HASFFI 14 | LJ_FUNC void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd); 15 | LJ_FUNC void LJ_FASTCALL recff_cdata_call(jit_State *J, RecordFFData *rd); 16 | LJ_FUNC void LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd); 17 | LJ_FUNC void LJ_FASTCALL recff_clib_index(jit_State *J, RecordFFData *rd); 18 | LJ_FUNC void LJ_FASTCALL recff_ffi_new(jit_State *J, RecordFFData *rd); 19 | LJ_FUNC void LJ_FASTCALL recff_ffi_errno(jit_State *J, RecordFFData *rd); 20 | LJ_FUNC void LJ_FASTCALL recff_ffi_string(jit_State *J, RecordFFData *rd); 21 | LJ_FUNC void LJ_FASTCALL recff_ffi_copy(jit_State *J, RecordFFData *rd); 22 | LJ_FUNC void LJ_FASTCALL recff_ffi_fill(jit_State *J, RecordFFData *rd); 23 | LJ_FUNC void LJ_FASTCALL recff_ffi_typeof(jit_State *J, RecordFFData *rd); 24 | LJ_FUNC void LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd); 25 | LJ_FUNC void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd); 26 | LJ_FUNC void LJ_FASTCALL recff_ffi_xof(jit_State *J, RecordFFData *rd); 27 | LJ_FUNC void LJ_FASTCALL recff_ffi_gc(jit_State *J, RecordFFData *rd); 28 | LJ_FUNC void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd); 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /deps/lua/src/lj_err.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Error handling. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_ERR_H 7 | #define _LJ_ERR_H 8 | 9 | #include 10 | 11 | #include "lj_obj.h" 12 | 13 | typedef enum { 14 | #define ERRDEF(name, msg) \ 15 | LJ_ERR_##name, LJ_ERR_##name##_ = LJ_ERR_##name + sizeof(msg)-1, 16 | #include "lj_errmsg.h" 17 | LJ_ERR__MAX 18 | } ErrMsg; 19 | 20 | LJ_DATA const char *lj_err_allmsg; 21 | #define err2msg(em) (lj_err_allmsg+(int)(em)) 22 | 23 | LJ_FUNC GCstr *lj_err_str(lua_State *L, ErrMsg em); 24 | LJ_FUNCA_NORET void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode); 25 | LJ_FUNC_NORET void lj_err_mem(lua_State *L); 26 | LJ_FUNC_NORET void lj_err_run(lua_State *L); 27 | LJ_FUNC_NORET void lj_err_msg(lua_State *L, ErrMsg em); 28 | LJ_FUNC_NORET void lj_err_lex(lua_State *L, GCstr *src, const char *tok, 29 | BCLine line, ErrMsg em, va_list argp); 30 | LJ_FUNC_NORET void lj_err_optype(lua_State *L, cTValue *o, ErrMsg opm); 31 | LJ_FUNC_NORET void lj_err_comp(lua_State *L, cTValue *o1, cTValue *o2); 32 | LJ_FUNC_NORET void lj_err_optype_call(lua_State *L, TValue *o); 33 | LJ_FUNC_NORET void lj_err_callermsg(lua_State *L, const char *msg); 34 | LJ_FUNC_NORET void lj_err_callerv(lua_State *L, ErrMsg em, ...); 35 | LJ_FUNC_NORET void lj_err_caller(lua_State *L, ErrMsg em); 36 | LJ_FUNC_NORET void lj_err_arg(lua_State *L, int narg, ErrMsg em); 37 | LJ_FUNC_NORET void lj_err_argv(lua_State *L, int narg, ErrMsg em, ...); 38 | LJ_FUNC_NORET void lj_err_argtype(lua_State *L, int narg, const char *xname); 39 | LJ_FUNC_NORET void lj_err_argt(lua_State *L, int narg, int tt); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /deps/lua/src/lj_ff.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Fast function IDs. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_FF_H 7 | #define _LJ_FF_H 8 | 9 | /* Fast function ID. */ 10 | typedef enum { 11 | FF_LUA_ = FF_LUA, /* Lua function (must be 0). */ 12 | FF_C_ = FF_C, /* Regular C function (must be 1). */ 13 | #define FFDEF(name) FF_##name, 14 | #include "lj_ffdef.h" 15 | FF__MAX 16 | } FastFunc; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /deps/lua/src/lj_ffrecord.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Fast function call recorder. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_FFRECORD_H 7 | #define _LJ_FFRECORD_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT 13 | /* Data used by handlers to record a fast function. */ 14 | typedef struct RecordFFData { 15 | TValue *argv; /* Runtime argument values. */ 16 | ptrdiff_t nres; /* Number of returned results (defaults to 1). */ 17 | uint32_t data; /* Per-ffid auxiliary data (opcode, literal etc.). */ 18 | } RecordFFData; 19 | 20 | LJ_FUNC int32_t lj_ffrecord_select_mode(jit_State *J, TRef tr, TValue *tv); 21 | LJ_FUNC void lj_ffrecord_func(jit_State *J); 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /deps/lua/src/lj_func.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Function handling (prototypes, functions and upvalues). 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_FUNC_H 7 | #define _LJ_FUNC_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Prototypes. */ 12 | LJ_FUNC void LJ_FASTCALL lj_func_freeproto(global_State *g, GCproto *pt); 13 | 14 | /* Upvalues. */ 15 | LJ_FUNCA void LJ_FASTCALL lj_func_closeuv(lua_State *L, TValue *level); 16 | LJ_FUNC void LJ_FASTCALL lj_func_freeuv(global_State *g, GCupval *uv); 17 | 18 | /* Functions (closures). */ 19 | LJ_FUNC GCfunc *lj_func_newC(lua_State *L, MSize nelems, GCtab *env); 20 | LJ_FUNC GCfunc *lj_func_newL_empty(lua_State *L, GCproto *pt, GCtab *env); 21 | LJ_FUNCA GCfunc *lj_func_newL_gc(lua_State *L, GCproto *pt, GCfuncL *parent); 22 | LJ_FUNC void LJ_FASTCALL lj_func_free(global_State *g, GCfunc *c); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /deps/lua/src/lj_gdbjit.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Client for the GDB JIT API. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_GDBJIT_H 7 | #define _LJ_GDBJIT_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT && defined(LUAJIT_USE_GDBJIT) 13 | 14 | LJ_FUNC void lj_gdbjit_addtrace(jit_State *J, GCtrace *T); 15 | LJ_FUNC void lj_gdbjit_deltrace(jit_State *J, GCtrace *T); 16 | 17 | #else 18 | #define lj_gdbjit_addtrace(J, T) UNUSED(T) 19 | #define lj_gdbjit_deltrace(J, T) UNUSED(T) 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /deps/lua/src/lj_mcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Machine code management. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_MCODE_H 7 | #define _LJ_MCODE_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASJIT || LJ_HASFFI 12 | LJ_FUNC void lj_mcode_sync(void *start, void *end); 13 | #endif 14 | 15 | #if LJ_HASJIT 16 | 17 | #include "lj_jit.h" 18 | 19 | LJ_FUNC void lj_mcode_free(jit_State *J); 20 | LJ_FUNC MCode *lj_mcode_reserve(jit_State *J, MCode **lim); 21 | LJ_FUNC void lj_mcode_commit(jit_State *J, MCode *m); 22 | LJ_FUNC void lj_mcode_abort(jit_State *J); 23 | LJ_FUNC MCode *lj_mcode_patch(jit_State *J, MCode *ptr, int finish); 24 | LJ_FUNC_NORET void lj_mcode_limiterr(jit_State *J, size_t need); 25 | 26 | #define lj_mcode_commitbot(J, m) (J->mcbot = (m)) 27 | 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /deps/lua/src/lj_meta.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Metamethod handling. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_META_H 7 | #define _LJ_META_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Metamethod handling */ 12 | LJ_FUNC void lj_meta_init(lua_State *L); 13 | LJ_FUNC cTValue *lj_meta_cache(GCtab *mt, MMS mm, GCstr *name); 14 | LJ_FUNC cTValue *lj_meta_lookup(lua_State *L, cTValue *o, MMS mm); 15 | #if LJ_HASFFI 16 | LJ_FUNC int lj_meta_tailcall(lua_State *L, cTValue *tv); 17 | #endif 18 | 19 | #define lj_meta_fastg(g, mt, mm) \ 20 | ((mt) == NULL ? NULL : ((mt)->nomm & (1u<<(mm))) ? NULL : \ 21 | lj_meta_cache(mt, mm, mmname_str(g, mm))) 22 | #define lj_meta_fast(L, mt, mm) lj_meta_fastg(G(L), mt, mm) 23 | 24 | /* C helpers for some instructions, called from assembler VM. */ 25 | LJ_FUNCA cTValue *lj_meta_tget(lua_State *L, cTValue *o, cTValue *k); 26 | LJ_FUNCA TValue *lj_meta_tset(lua_State *L, cTValue *o, cTValue *k); 27 | LJ_FUNCA TValue *lj_meta_arith(lua_State *L, TValue *ra, cTValue *rb, 28 | cTValue *rc, BCReg op); 29 | LJ_FUNCA TValue *lj_meta_cat(lua_State *L, TValue *top, int left); 30 | LJ_FUNCA TValue * LJ_FASTCALL lj_meta_len(lua_State *L, cTValue *o); 31 | LJ_FUNCA TValue *lj_meta_equal(lua_State *L, GCobj *o1, GCobj *o2, int ne); 32 | LJ_FUNCA TValue * LJ_FASTCALL lj_meta_equal_cd(lua_State *L, BCIns ins); 33 | LJ_FUNCA TValue *lj_meta_comp(lua_State *L, cTValue *o1, cTValue *o2, int op); 34 | LJ_FUNCA void lj_meta_call(lua_State *L, TValue *func, TValue *top); 35 | LJ_FUNCA void LJ_FASTCALL lj_meta_for(lua_State *L, TValue *o); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /deps/lua/src/lj_obj.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Miscellaneous object handling. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_obj_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Object type names. */ 12 | LJ_DATADEF const char *const lj_obj_typename[] = { /* ORDER LUA_T */ 13 | "no value", "nil", "boolean", "userdata", "number", "string", 14 | "table", "function", "userdata", "thread", "proto", "cdata" 15 | }; 16 | 17 | LJ_DATADEF const char *const lj_obj_itypename[] = { /* ORDER LJ_T */ 18 | "nil", "boolean", "boolean", "userdata", "string", "upval", "thread", 19 | "proto", "function", "trace", "cdata", "table", "userdata", "number" 20 | }; 21 | 22 | /* Compare two objects without calling metamethods. */ 23 | int lj_obj_equal(cTValue *o1, cTValue *o2) 24 | { 25 | if (itype(o1) == itype(o2)) { 26 | if (tvispri(o1)) 27 | return 1; 28 | if (!tvisnum(o1)) 29 | return gcrefeq(o1->gcr, o2->gcr); 30 | } else if (!tvisnumber(o1) || !tvisnumber(o2)) { 31 | return 0; 32 | } 33 | return numberVnum(o1) == numberVnum(o2); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /deps/lua/src/lj_parse.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Lua parser (source code -> bytecode). 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_PARSE_H 7 | #define _LJ_PARSE_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_lex.h" 11 | 12 | LJ_FUNC GCproto *lj_parse(LexState *ls); 13 | LJ_FUNC GCstr *lj_parse_keepstr(LexState *ls, const char *str, size_t l); 14 | #if LJ_HASFFI 15 | LJ_FUNC void lj_parse_keepcdata(LexState *ls, TValue *tv, GCcdata *cd); 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /deps/lua/src/lj_record.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace recorder (bytecode -> SSA IR). 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_RECORD_H 7 | #define _LJ_RECORD_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT 13 | /* Context for recording an indexed load/store. */ 14 | typedef struct RecordIndex { 15 | TValue tabv; /* Runtime value of table (or indexed object). */ 16 | TValue keyv; /* Runtime value of key. */ 17 | TValue valv; /* Runtime value of stored value. */ 18 | TValue mobjv; /* Runtime value of metamethod object. */ 19 | GCtab *mtv; /* Runtime value of metatable object. */ 20 | cTValue *oldv; /* Runtime value of previously stored value. */ 21 | TRef tab; /* Table (or indexed object) reference. */ 22 | TRef key; /* Key reference. */ 23 | TRef val; /* Value reference for a store or 0 for a load. */ 24 | TRef mt; /* Metatable reference. */ 25 | TRef mobj; /* Metamethod object reference. */ 26 | int idxchain; /* Index indirections left or 0 for raw lookup. */ 27 | } RecordIndex; 28 | 29 | LJ_FUNC int lj_record_objcmp(jit_State *J, TRef a, TRef b, 30 | cTValue *av, cTValue *bv); 31 | LJ_FUNC TRef lj_record_constify(jit_State *J, cTValue *o); 32 | 33 | LJ_FUNC void lj_record_call(jit_State *J, BCReg func, ptrdiff_t nargs); 34 | LJ_FUNC void lj_record_tailcall(jit_State *J, BCReg func, ptrdiff_t nargs); 35 | LJ_FUNC void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults); 36 | 37 | LJ_FUNC int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm); 38 | LJ_FUNC TRef lj_record_idx(jit_State *J, RecordIndex *ix); 39 | 40 | LJ_FUNC void lj_record_ins(jit_State *J); 41 | LJ_FUNC void lj_record_setup(jit_State *J); 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /deps/lua/src/lj_snap.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Snapshot handling. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_SNAP_H 7 | #define _LJ_SNAP_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT 13 | LJ_FUNC void lj_snap_add(jit_State *J); 14 | LJ_FUNC void lj_snap_purge(jit_State *J); 15 | LJ_FUNC void lj_snap_shrink(jit_State *J); 16 | LJ_FUNC IRIns *lj_snap_regspmap(GCtrace *T, SnapNo snapno, IRIns *ir); 17 | LJ_FUNC void lj_snap_replay(jit_State *J, GCtrace *T); 18 | LJ_FUNC const BCIns *lj_snap_restore(jit_State *J, void *exptr); 19 | LJ_FUNC void lj_snap_grow_buf_(jit_State *J, MSize need); 20 | LJ_FUNC void lj_snap_grow_map_(jit_State *J, MSize need); 21 | 22 | static LJ_AINLINE void lj_snap_grow_buf(jit_State *J, MSize need) 23 | { 24 | if (LJ_UNLIKELY(need > J->sizesnap)) lj_snap_grow_buf_(J, need); 25 | } 26 | 27 | static LJ_AINLINE void lj_snap_grow_map(jit_State *J, MSize need) 28 | { 29 | if (LJ_UNLIKELY(need > J->sizesnapmap)) lj_snap_grow_map_(J, need); 30 | } 31 | 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /deps/lua/src/lj_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** State and stack handling. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_STATE_H 7 | #define _LJ_STATE_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #define incr_top(L) \ 12 | (++L->top >= tvref(L->maxstack) && (lj_state_growstack1(L), 0)) 13 | 14 | #define savestack(L, p) ((char *)(p) - mref(L->stack, char)) 15 | #define restorestack(L, n) ((TValue *)(mref(L->stack, char) + (n))) 16 | 17 | LJ_FUNC void lj_state_relimitstack(lua_State *L); 18 | LJ_FUNC void lj_state_shrinkstack(lua_State *L, MSize used); 19 | LJ_FUNCA void LJ_FASTCALL lj_state_growstack(lua_State *L, MSize need); 20 | LJ_FUNC void LJ_FASTCALL lj_state_growstack1(lua_State *L); 21 | 22 | static LJ_AINLINE void lj_state_checkstack(lua_State *L, MSize need) 23 | { 24 | if ((mref(L->maxstack, char) - (char *)L->top) <= 25 | (ptrdiff_t)need*(ptrdiff_t)sizeof(TValue)) 26 | lj_state_growstack(L, need); 27 | } 28 | 29 | LJ_FUNC lua_State *lj_state_new(lua_State *L); 30 | LJ_FUNC void LJ_FASTCALL lj_state_free(global_State *g, lua_State *L); 31 | #if LJ_64 32 | LJ_FUNC lua_State *lj_state_newstate(lua_Alloc f, void *ud); 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /deps/lua/src/lj_strscan.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** String scanning. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_STRSCAN_H 7 | #define _LJ_STRSCAN_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Options for accepted/returned formats. */ 12 | #define STRSCAN_OPT_TOINT 0x01 /* Convert to int32_t, if possible. */ 13 | #define STRSCAN_OPT_TONUM 0x02 /* Always convert to double. */ 14 | #define STRSCAN_OPT_IMAG 0x04 15 | #define STRSCAN_OPT_LL 0x08 16 | #define STRSCAN_OPT_C 0x10 17 | 18 | /* Returned format. */ 19 | typedef enum { 20 | STRSCAN_ERROR, 21 | STRSCAN_NUM, STRSCAN_IMAG, 22 | STRSCAN_INT, STRSCAN_U32, STRSCAN_I64, STRSCAN_U64, 23 | } StrScanFmt; 24 | 25 | LJ_FUNC StrScanFmt lj_strscan_scan(const uint8_t *p, TValue *o, uint32_t opt); 26 | LJ_FUNC int LJ_FASTCALL lj_strscan_num(GCstr *str, TValue *o); 27 | #if LJ_DUALNUM 28 | LJ_FUNC int LJ_FASTCALL lj_strscan_number(GCstr *str, TValue *o); 29 | #else 30 | #define lj_strscan_number(s, o) lj_strscan_num((s), (o)) 31 | #endif 32 | 33 | /* Check for number or convert string to number/int in-place (!). */ 34 | static LJ_AINLINE int lj_strscan_numberobj(TValue *o) 35 | { 36 | return tvisnumber(o) || (tvisstr(o) && lj_strscan_number(strV(o), o)); 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /deps/lua/src/lj_trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace management. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_TRACE_H 7 | #define _LJ_TRACE_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASJIT 12 | #include "lj_jit.h" 13 | #include "lj_dispatch.h" 14 | 15 | /* Trace errors. */ 16 | typedef enum { 17 | #define TREDEF(name, msg) LJ_TRERR_##name, 18 | #include "lj_traceerr.h" 19 | LJ_TRERR__MAX 20 | } TraceError; 21 | 22 | LJ_FUNC_NORET void lj_trace_err(jit_State *J, TraceError e); 23 | LJ_FUNC_NORET void lj_trace_err_info(jit_State *J, TraceError e); 24 | 25 | /* Trace management. */ 26 | LJ_FUNC void LJ_FASTCALL lj_trace_free(global_State *g, GCtrace *T); 27 | LJ_FUNC void lj_trace_reenableproto(GCproto *pt); 28 | LJ_FUNC void lj_trace_flushproto(global_State *g, GCproto *pt); 29 | LJ_FUNC void lj_trace_flush(jit_State *J, TraceNo traceno); 30 | LJ_FUNC int lj_trace_flushall(lua_State *L); 31 | LJ_FUNC void lj_trace_initstate(global_State *g); 32 | LJ_FUNC void lj_trace_freestate(global_State *g); 33 | 34 | /* Event handling. */ 35 | LJ_FUNC void lj_trace_ins(jit_State *J, const BCIns *pc); 36 | LJ_FUNCA void LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc); 37 | LJ_FUNCA int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr); 38 | 39 | /* Signal asynchronous abort of trace or end of trace. */ 40 | #define lj_trace_abort(g) (G2J(g)->state &= ~LJ_TRACE_ACTIVE) 41 | #define lj_trace_end(J) (J->state = LJ_TRACE_END) 42 | 43 | #else 44 | 45 | #define lj_trace_flushall(L) (UNUSED(L), 0) 46 | #define lj_trace_initstate(g) UNUSED(g) 47 | #define lj_trace_freestate(g) UNUSED(g) 48 | #define lj_trace_abort(g) UNUSED(g) 49 | #define lj_trace_end(J) UNUSED(J) 50 | 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /deps/lua/src/lj_udata.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Userdata handling. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_udata_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | #include "lj_gc.h" 11 | #include "lj_udata.h" 12 | 13 | GCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env) 14 | { 15 | GCudata *ud = lj_mem_newt(L, sizeof(GCudata) + sz, GCudata); 16 | global_State *g = G(L); 17 | newwhite(g, ud); /* Not finalized. */ 18 | ud->gct = ~LJ_TUDATA; 19 | ud->udtype = UDTYPE_USERDATA; 20 | ud->len = sz; 21 | /* NOBARRIER: The GCudata is new (marked white). */ 22 | setgcrefnull(ud->metatable); 23 | setgcref(ud->env, obj2gco(env)); 24 | /* Chain to userdata list (after main thread). */ 25 | setgcrefr(ud->nextgc, mainthread(g)->nextgc); 26 | setgcref(mainthread(g)->nextgc, obj2gco(ud)); 27 | return ud; 28 | } 29 | 30 | void LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud) 31 | { 32 | lj_mem_free(g, ud, sizeudata(ud)); 33 | } 34 | 35 | -------------------------------------------------------------------------------- /deps/lua/src/lj_udata.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Userdata handling. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_UDATA_H 7 | #define _LJ_UDATA_H 8 | 9 | #include "lj_obj.h" 10 | 11 | LJ_FUNC GCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env); 12 | LJ_FUNC void LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /deps/lua/src/lj_vmevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** VM event handling. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #include 7 | 8 | #define lj_vmevent_c 9 | #define LUA_CORE 10 | 11 | #include "lj_obj.h" 12 | #include "lj_str.h" 13 | #include "lj_tab.h" 14 | #include "lj_state.h" 15 | #include "lj_dispatch.h" 16 | #include "lj_vm.h" 17 | #include "lj_vmevent.h" 18 | 19 | ptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev) 20 | { 21 | global_State *g = G(L); 22 | GCstr *s = lj_str_newlit(L, LJ_VMEVENTS_REGKEY); 23 | cTValue *tv = lj_tab_getstr(tabV(registry(L)), s); 24 | if (tvistab(tv)) { 25 | int hash = VMEVENT_HASH(ev); 26 | tv = lj_tab_getint(tabV(tv), hash); 27 | if (tv && tvisfunc(tv)) { 28 | lj_state_checkstack(L, LUA_MINSTACK); 29 | setfuncV(L, L->top++, funcV(tv)); 30 | return savestack(L, L->top); 31 | } 32 | } 33 | g->vmevmask &= ~VMEVENT_MASK(ev); /* No handler: cache this fact. */ 34 | return 0; 35 | } 36 | 37 | void lj_vmevent_call(lua_State *L, ptrdiff_t argbase) 38 | { 39 | global_State *g = G(L); 40 | uint8_t oldmask = g->vmevmask; 41 | uint8_t oldh = hook_save(g); 42 | int status; 43 | g->vmevmask = 0; /* Disable all events. */ 44 | hook_vmevent(g); 45 | status = lj_vm_pcall(L, restorestack(L, argbase), 0+1, 0); 46 | if (LJ_UNLIKELY(status)) { 47 | /* Really shouldn't use stderr here, but where else to complain? */ 48 | L->top--; 49 | fputs("VM handler failed: ", stderr); 50 | fputs(tvisstr(L->top) ? strVdata(L->top) : "?", stderr); 51 | fputc('\n', stderr); 52 | } 53 | hook_restore(g, oldh); 54 | if (g->vmevmask != VMEVENT_NOCACHE) 55 | g->vmevmask = oldmask; /* Restore event mask, but not if not modified. */ 56 | } 57 | 58 | -------------------------------------------------------------------------------- /deps/lua/src/lj_vmevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** VM event handling. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_VMEVENT_H 7 | #define _LJ_VMEVENT_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Registry key for VM event handler table. */ 12 | #define LJ_VMEVENTS_REGKEY "_VMEVENTS" 13 | #define LJ_VMEVENTS_HSIZE 4 14 | 15 | #define VMEVENT_MASK(ev) ((uint8_t)1 << ((int)(ev) & 7)) 16 | #define VMEVENT_HASH(ev) ((int)(ev) & ~7) 17 | #define VMEVENT_HASHIDX(h) ((int)(h) << 3) 18 | #define VMEVENT_NOCACHE 255 19 | 20 | #define VMEVENT_DEF(name, hash) \ 21 | LJ_VMEVENT_##name##_, \ 22 | LJ_VMEVENT_##name = ((LJ_VMEVENT_##name##_) & 7)|((hash) << 3) 23 | 24 | /* VM event IDs. */ 25 | typedef enum { 26 | VMEVENT_DEF(BC, 0x00003883), 27 | VMEVENT_DEF(TRACE, 0xb2d91467), 28 | VMEVENT_DEF(RECORD, 0x9284bf4f), 29 | VMEVENT_DEF(TEXIT, 0xb29df2b0), 30 | LJ_VMEVENT__MAX 31 | } VMEvent; 32 | 33 | #ifdef LUAJIT_DISABLE_VMEVENT 34 | #define lj_vmevent_send(L, ev, args) UNUSED(L) 35 | #define lj_vmevent_send_(L, ev, args, post) UNUSED(L) 36 | #else 37 | #define lj_vmevent_send(L, ev, args) \ 38 | if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \ 39 | ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \ 40 | if (argbase) { \ 41 | args \ 42 | lj_vmevent_call(L, argbase); \ 43 | } \ 44 | } 45 | #define lj_vmevent_send_(L, ev, args, post) \ 46 | if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \ 47 | ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \ 48 | if (argbase) { \ 49 | args \ 50 | lj_vmevent_call(L, argbase); \ 51 | post \ 52 | } \ 53 | } 54 | 55 | LJ_FUNC ptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev); 56 | LJ_FUNC void lj_vmevent_call(lua_State *L, ptrdiff_t argbase); 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /deps/lua/src/lua.hpp: -------------------------------------------------------------------------------- 1 | // C++ wrapper for LuaJIT header files. 2 | 3 | extern "C" { 4 | #include "lua.h" 5 | #include "lauxlib.h" 6 | #include "lualib.h" 7 | #include "luajit.h" 8 | } 9 | 10 | -------------------------------------------------------------------------------- /deps/lua/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Standard library header. 3 | ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LUALIB_H 7 | #define _LUALIB_H 8 | 9 | #include "lua.h" 10 | 11 | #define LUA_FILEHANDLE "FILE*" 12 | 13 | #define LUA_COLIBNAME "coroutine" 14 | #define LUA_MATHLIBNAME "math" 15 | #define LUA_STRLIBNAME "string" 16 | #define LUA_TABLIBNAME "table" 17 | #define LUA_IOLIBNAME "io" 18 | #define LUA_OSLIBNAME "os" 19 | #define LUA_LOADLIBNAME "package" 20 | #define LUA_DBLIBNAME "debug" 21 | #define LUA_BITLIBNAME "bit" 22 | #define LUA_JITLIBNAME "jit" 23 | #define LUA_FFILIBNAME "ffi" 24 | 25 | LUALIB_API int luaopen_base(lua_State *L); 26 | LUALIB_API int luaopen_math(lua_State *L); 27 | LUALIB_API int luaopen_string(lua_State *L); 28 | LUALIB_API int luaopen_table(lua_State *L); 29 | LUALIB_API int luaopen_io(lua_State *L); 30 | LUALIB_API int luaopen_os(lua_State *L); 31 | LUALIB_API int luaopen_package(lua_State *L); 32 | LUALIB_API int luaopen_debug(lua_State *L); 33 | LUALIB_API int luaopen_bit(lua_State *L); 34 | LUALIB_API int luaopen_jit(lua_State *L); 35 | LUALIB_API int luaopen_ffi(lua_State *L); 36 | 37 | LUALIB_API void luaL_openlibs(lua_State *L); 38 | 39 | #ifndef lua_assert 40 | #define lua_assert(x) ((void)0) 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /deps/snappy-1.1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/deps/snappy-1.1.0.tar.gz -------------------------------------------------------------------------------- /php-hiredis/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006-2009, Sebastian Waisbrot 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * Neither the name of Redis nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | -------------------------------------------------------------------------------- /php-hiredis/TODO: -------------------------------------------------------------------------------- 1 | Add types to multi-bulk response 2 | -------------------------------------------------------------------------------- /php-hiredis/config.m4: -------------------------------------------------------------------------------- 1 | PHP_ARG_ENABLE(phpiredis, whether to enable phpiredis support, 2 | [ --enable-phpiredis Enable phpiredis support]) 3 | 4 | PHP_ARG_WITH(hiredis-dir, for hiredis library, 5 | [ --with-hiredis-dir[=DIR] Set the path to hiredis install prefix.], yes) 6 | 7 | if test "$PHP_PHPIREDIS" = "yes"; then 8 | AC_DEFINE(HAVE_PHPIREDIS, 1, [Whether you have phpiredis]) 9 | 10 | PKG_CONFIG=`which pkg-config` 11 | 12 | if test "$PHP_HIREDIS_DIR" != "no" && test "$PHP_HIREDIS_DIR" != "yes"; then 13 | for i in $PHP_HIREDIS_DIR /usr /usr/local; do 14 | if test -r $i/include/$SEARCH_FOR; then 15 | HIREDIS_DIR=$i 16 | break 17 | fi 18 | done 19 | if test -z $HIREDIS_DIR; then 20 | AC_MSG_RESULT(not found) 21 | AC_MSG_ERROR(Could not find hiredis in search paths) 22 | fi 23 | AC_MSG_RESULT(Found hiredis in $HIREDIS_DIR) 24 | PHP_EVAL_LIBLINE(-lhiredis, PHPIREDIS_SHARED_LIBADD) 25 | PHP_EVAL_INCLINE(-I$HIREDIS_DIR/include) 26 | elif $PKG_CONFIG --exists hiredis; then 27 | HIREDIS_VERSION=`$PKG_CONFIG --modversion hiredis` 28 | AC_MSG_RESULT([Found hiredis $HIREDIS_VERSION]) 29 | PHP_EVAL_INCLINE(`$PKG_CONFIG --cflags-only-I hiredis`) 30 | PHP_EVAL_LIBLINE(`$PKG_CONFIG --libs hiredis`, PHPIREDIS_SHARED_LIBADD) 31 | else 32 | AC_MSG_RESULT(not found) 33 | AC_MSG_ERROR(Ooops ! hiredis not found) 34 | fi 35 | 36 | PHP_SUBST(PHPIREDIS_SHARED_LIBADD) 37 | PHP_NEW_EXTENSION(phpiredis, phpiredis.c, $ext_shared) 38 | fi 39 | -------------------------------------------------------------------------------- /php-hiredis/php_phpiredis.h: -------------------------------------------------------------------------------- 1 | #ifndef PHP_PHPIREDIS_H 2 | #define PHP_PHPIREDIS_H 1 3 | 4 | #define PHP_PHPIREDIS_VERSION "1.0" 5 | #define PHP_PHPIREDIS_EXTNAME "phpiredis" 6 | 7 | PHP_MINIT_FUNCTION(phpiredis); 8 | PHP_FUNCTION(phpiredis_connect); 9 | PHP_FUNCTION(phpiredis_pconnect); 10 | PHP_FUNCTION(phpiredis_disconnect); 11 | PHP_FUNCTION(phpiredis_command_bs); 12 | PHP_FUNCTION(phpiredis_command); 13 | PHP_FUNCTION(phpiredis_murmurhash2); 14 | PHP_FUNCTION(phpiredis_multi_command); 15 | PHP_FUNCTION(phpiredis_format_command); 16 | PHP_FUNCTION(phpiredis_reader_create); 17 | PHP_FUNCTION(phpiredis_reader_reset); 18 | PHP_FUNCTION(phpiredis_reader_feed); 19 | PHP_FUNCTION(phpiredis_reader_get_state); 20 | PHP_FUNCTION(phpiredis_reader_get_error); 21 | PHP_FUNCTION(phpiredis_reader_get_reply); 22 | PHP_FUNCTION(phpiredis_reader_destroy); 23 | PHP_FUNCTION(phpiredis_reader_set_error_handler); 24 | PHP_FUNCTION(phpiredis_reader_set_status_handler); 25 | 26 | extern zend_module_entry phpiredis_module_entry; 27 | #define phpext_phpiredis_ptr &phpiredis_module_entry 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /php-hiredis/php_phpiredis_struct.h: -------------------------------------------------------------------------------- 1 | #include "hiredis/hiredis.h" 2 | 3 | typedef struct _phpiredis_connection { 4 | redisContext *c; 5 | char* ip; 6 | int port; 7 | } phpiredis_connection; 8 | 9 | typedef struct _phpiredis_reader { 10 | void *reader; 11 | void *bufferedReply; 12 | char* error; 13 | void* status_callback; 14 | void* error_callback; 15 | } phpiredis_reader; 16 | 17 | #define PHPIREDIS_READER_STATE_COMPLETE 1 18 | #define PHPIREDIS_READER_STATE_INCOMPLETE 2 19 | #define PHPIREDIS_READER_STATE_ERROR 3 20 | -------------------------------------------------------------------------------- /php-hiredis/tests/001.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis connect 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 17 | --EXPECTF-- 18 | resource(%d) of type (phpredis connection) 19 | -------------------------------------------------------------------------------- /php-hiredis/tests/002.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis command 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 19 | --EXPECTF-- 20 | string(1) "1" 21 | 22 | -------------------------------------------------------------------------------- /php-hiredis/tests/003.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis multicommand 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 18 | --EXPECTF-- 19 | string(1) "1" 20 | 21 | -------------------------------------------------------------------------------- /php-hiredis/tests/004.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis array 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 18 | --EXPECTF-- 19 | array(3) { 20 | [0]=> 21 | string(1) "3" 22 | [1]=> 23 | string(1) "2" 24 | [2]=> 25 | string(1) "1" 26 | } 27 | -------------------------------------------------------------------------------- /php-hiredis/tests/005.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis multicommand 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 20 | --EXPECTF-- 21 | int(1) 22 | -------------------------------------------------------------------------------- /php-hiredis/tests/006.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis command binary safe 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 19 | --EXPECTF-- 20 | string(1) "1" 21 | -------------------------------------------------------------------------------- /php-hiredis/tests/007.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis command binary safe using image 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 27 | --EXPECTF-- 28 | bool(true) 29 | -------------------------------------------------------------------------------- /php-hiredis/tests/008.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis reconnect on disconnect 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 20 | --EXPECTF-- 21 | string(1) "1" 22 | string(2) "OK" 23 | string(1) "1" 24 | -------------------------------------------------------------------------------- /php-hiredis/tests/009.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis reconnect on disconnect 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 18 | --EXPECTF-- 19 | array(3) { 20 | [0]=> 21 | string(1) "1" 22 | [1]=> 23 | string(2) "OK" 24 | [2]=> 25 | bool(false) 26 | } 27 | -------------------------------------------------------------------------------- /php-hiredis/tests/010.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis command formatting 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 9 | --EXPECTF-- 10 | string(25) "*3 11 | $1 12 | a 13 | $1 14 | s 15 | $1 16 | d 17 | " 18 | -------------------------------------------------------------------------------- /php-hiredis/tests/011.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis create and destroy reader 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 11 | --EXPECTF-- 12 | resource(%d) of type (phpredis reader) 13 | -------------------------------------------------------------------------------- /php-hiredis/tests/012.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis reader feed and parse 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 23 | --EXPECTF-- 24 | string(2) "OK" 25 | string(5) "Error" 26 | bool(false) 27 | int(123) 28 | string(3) "SET" 29 | array(3) { 30 | [0]=> 31 | string(3) "SET" 32 | [1]=> 33 | string(1) "a" 34 | [2]=> 35 | string(2) "AS" 36 | } 37 | bool(false) 38 | string(42) "Protocol error, got "n" as reply type byte" 39 | -------------------------------------------------------------------------------- /php-hiredis/tests/013.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis reader feed and parse 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 24 | --EXPECTF-- 25 | string(2) "OK" 26 | bool(true) 27 | bool(true) 28 | string(2) "OK" 29 | bool(true) 30 | bool(true) 31 | string(3) "SET" 32 | bool(true) 33 | bool(true) 34 | string(42) "Protocol error, got "n" as reply type byte" 35 | -------------------------------------------------------------------------------- /php-hiredis/tests/014.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis reader resetting 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 17 | --EXPECTF-- 18 | bool(true) 19 | bool(true) 20 | -------------------------------------------------------------------------------- /php-hiredis/tests/015.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis reader resetting 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 17 | --EXPECTF-- 18 | bool(true) 19 | bool(true) 20 | bool(true) 21 | bool(true) 22 | -------------------------------------------------------------------------------- /php-hiredis/tests/016.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | phpiredis command formatting 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 10 | --EXPECTF-- 11 | string(31) "*3 12 | $3 13 | SET 14 | $3 15 | key 16 | $3 17 | 112 18 | " 19 | string(31) "*3 20 | $3 21 | SET 22 | $3 23 | key 24 | $3 25 | 1.2 26 | " 27 | -------------------------------------------------------------------------------- /php-hiredis/tests/017.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Set reader error handler 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 21 | --EXPECTF-- 22 | bool(true) 23 | bool(true) 24 | bool(true) 25 | bool(true) 26 | bool(true) 27 | bool(true) 28 | -------------------------------------------------------------------------------- /php-hiredis/tests/018.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Set status handler 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 21 | --EXPECTF-- 22 | bool(true) 23 | bool(true) 24 | bool(true) 25 | bool(true) 26 | bool(true) 27 | bool(true) 28 | -------------------------------------------------------------------------------- /php-hiredis/tests/019.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Throwing exceptions in error handler and returning objects 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | err = $err; return $r; } 9 | $reader = phpiredis_reader_create(); 10 | phpiredis_reader_set_error_handler($reader, 'error_handler_exception'); 11 | phpiredis_reader_feed($reader, "-ERR\r\n"); 12 | try { 13 | phpiredis_reader_get_reply($reader); 14 | var_dump(FALSE); 15 | } catch (Exception $e) { 16 | var_dump($e->getMessage() == 'ERR'); 17 | } 18 | phpiredis_reader_set_error_handler($reader, 'error_handler_object'); 19 | phpiredis_reader_feed($reader, "-ERR\r\n"); 20 | var_dump(phpiredis_reader_get_reply($reader)); 21 | ?> 22 | --EXPECTF-- 23 | bool(true) 24 | object(stdClass)#2 (1) { 25 | ["err"]=> 26 | string(3) "ERR" 27 | } 28 | -------------------------------------------------------------------------------- /php-hiredis/tests/020.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Set reader error handler 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 18 | --EXPECTF-- 19 | NULL 20 | NULL 21 | array(1) { 22 | [0]=> 23 | NULL 24 | } 25 | -------------------------------------------------------------------------------- /php-hiredis/tests/021.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Keep multibulk replies type 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 12 | --EXPECTF-- 13 | array(3) { 14 | [0]=> 15 | int(1) 16 | [1]=> 17 | string(2) "OK" 18 | [2]=> 19 | array(2) { 20 | [0]=> 21 | string(3) "ASD" 22 | [1]=> 23 | NULL 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /php-hiredis/tests/022.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test possible segfault 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 21 | --EXPECTF-- 22 | string(2) "OK" 23 | string(6) "QUEUED" 24 | array(1) { 25 | [0]=> 26 | int(1) 27 | } 28 | -------------------------------------------------------------------------------- /php-hiredis/tests/023.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | format parameters are not modified 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 11 | --EXPECTF-- 12 | string(29) "*3 13 | $3 14 | SET 15 | $3 16 | key 17 | $1 18 | 1 19 | " 20 | array(3) { 21 | [0]=> 22 | string(3) "SET" 23 | [1]=> 24 | string(3) "key" 25 | [2]=> 26 | int(1) 27 | } 28 | -------------------------------------------------------------------------------- /php-hiredis/tests/connect.inc: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /redis.conf: -------------------------------------------------------------------------------- 1 | daemonize yes 2 | pidfile ./log/redis.pid 3 | port 6379 4 | bind 127.0.0.1 5 | timeout 0 6 | loglevel notice 7 | logfile ./log/redis.log 8 | databases 16 9 | stop-writes-on-bgsave-error yes 10 | rdbcompression yes 11 | rdbchecksum yes 12 | dbfilename redis_storage.rdb 13 | dir ./ 14 | slave-serve-stale-data yes 15 | slave-read-only yes 16 | slave-priority 100 17 | appendfsync everysec 18 | no-appendfsync-on-rewrite no 19 | auto-aof-rewrite-percentage 100 20 | auto-aof-rewrite-min-size 64mb 21 | lua-time-limit 5000 22 | slowlog-log-slower-than 10000 23 | slowlog-max-len 128 24 | hash-max-ziplist-entries 512 25 | hash-max-ziplist-value 64 26 | list-max-ziplist-entries 512 27 | list-max-ziplist-value 64 28 | set-max-intset-entries 512 29 | zset-max-ziplist-entries 128 30 | zset-max-ziplist-value 64 31 | activerehashing yes 32 | client-output-buffer-limit normal 0 0 0 33 | client-output-buffer-limit slave 256mb 64mb 60 34 | client-output-buffer-limit pubsub 32mb 8mb 60 35 | ds:open 1 36 | ds:create_if_missing 1 37 | ds:error_if_exists 0 38 | ds:paranoid_checks 0 39 | ds:ds_lru_cache 500 40 | ds:write_buffer_size 64 41 | ds:block_size 32 42 | ds:max_open_files 1000 43 | ds:block_restart_interval 16 44 | ds:path ./db/leveldb 45 | rl:ttl 172800 46 | rl:ttlcheck 14400 -------------------------------------------------------------------------------- /redis_storage.so.conf: -------------------------------------------------------------------------------- 1 | /usr/local/lib -------------------------------------------------------------------------------- /runtest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TCL_VERSIONS="8.5 8.6" 3 | TCLSH="" 4 | 5 | for VERSION in $TCL_VERSIONS; do 6 | TCL=`which tclsh$VERSION 2>/dev/null` && TCLSH=$TCL 7 | done 8 | 9 | if [ -z $TCLSH ] 10 | then 11 | echo "You need tcl 8.5 or newer in order to run the Redis test" 12 | exit 1 13 | fi 14 | $TCLSH tests/test_helper.tcl $* 15 | -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/src/.DS_Store -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | *.gcda 2 | *.gcno 3 | *.gcov 4 | redis.info 5 | lcov-html 6 | -------------------------------------------------------------------------------- /src/.make-prerequisites: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/src/.make-prerequisites -------------------------------------------------------------------------------- /src/.make-settings: -------------------------------------------------------------------------------- 1 | STD=-std=c99 -pedantic 2 | WARN=-Wall 3 | OPT=-O2 4 | MALLOC=tcmalloc_minimal 5 | CFLAGS= 6 | LDFLAGS= 7 | REDIS_CFLAGS= 8 | REDIS_LDFLAGS= 9 | PREV_FINAL_CFLAGS=-std=c99 -pedantic -Wall -O2 -g -rdynamic -ggdb -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/leveldb-1.10.0/include -I../deps/gperftools-2.0/src -DUSE_TCMALLOC 10 | PREV_FINAL_LDFLAGS= -g -rdynamic -ggdb 11 | -------------------------------------------------------------------------------- /src/mkreleasehdr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1` 3 | GIT_DIRTY=`git diff 2> /dev/null | wc -l` 4 | test -f release.h || touch release.h 5 | (cat release.h | grep SHA1 | grep $GIT_SHA1) && \ 6 | (cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already uptodate 7 | echo "#define REDIS_GIT_SHA1 \"$GIT_SHA1\"" > release.h 8 | echo "#define REDIS_GIT_DIRTY \"$GIT_DIRTY\"" >> release.h 9 | touch release.c # Force recompile of release.c 10 | -------------------------------------------------------------------------------- /src/release.h: -------------------------------------------------------------------------------- 1 | #define REDIS_GIT_SHA1 "d859d85f" 2 | #define REDIS_GIT_DIRTY "523" 3 | -------------------------------------------------------------------------------- /src/sha1.h: -------------------------------------------------------------------------------- 1 | /* ================ sha1.h ================ */ 2 | /* 3 | SHA-1 in C 4 | By Steve Reid 5 | 100% Public Domain 6 | */ 7 | 8 | typedef struct { 9 | u_int32_t state[5]; 10 | u_int32_t count[2]; 11 | unsigned char buffer[64]; 12 | } SHA1_CTX; 13 | 14 | void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64]); 15 | void SHA1Init(SHA1_CTX* context); 16 | void SHA1Update(SHA1_CTX* context, const unsigned char* data, u_int32_t len); 17 | void SHA1Final(unsigned char digest[20], SHA1_CTX* context); 18 | -------------------------------------------------------------------------------- /src/valgrind.sup: -------------------------------------------------------------------------------- 1 | { 2 | 3 | Memcheck:Cond 4 | fun:lzf_compress 5 | } 6 | 7 | { 8 | 9 | Memcheck:Value4 10 | fun:lzf_compress 11 | } 12 | 13 | { 14 | 15 | Memcheck:Value8 16 | fun:lzf_compress 17 | } 18 | -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | #define REDIS_VERSION "redis:2.6.14, leveldb:1.10.0, snappy:1.1.0" 2 | -------------------------------------------------------------------------------- /tests/assets/default.conf: -------------------------------------------------------------------------------- 1 | # Redis configuration for testing. 2 | 3 | daemonize no 4 | pidfile /var/run/redis.pid 5 | port 6379 6 | timeout 0 7 | loglevel verbose 8 | logfile stdout 9 | databases 16 10 | 11 | save 900 1 12 | save 300 10 13 | save 60 10000 14 | 15 | rdbcompression yes 16 | dbfilename dump.rdb 17 | dir ./ 18 | 19 | slave-serve-stale-data yes 20 | appendonly no 21 | appendfsync everysec 22 | no-appendfsync-on-rewrite no 23 | activerehashing yes 24 | -------------------------------------------------------------------------------- /tests/assets/encodings.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/tests/assets/encodings.rdb -------------------------------------------------------------------------------- /tests/assets/hash-zipmap.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shenzhe/redis-storage/42d302b23456148ff490e6b72949fea6e9e986ed/tests/assets/hash-zipmap.rdb -------------------------------------------------------------------------------- /tests/helpers/bg_complex_data.tcl: -------------------------------------------------------------------------------- 1 | source tests/support/redis.tcl 2 | source tests/support/util.tcl 3 | 4 | proc bg_complex_data {host port db ops} { 5 | set r [redis $host $port] 6 | $r select $db 7 | createComplexDataset $r $ops 8 | } 9 | 10 | bg_complex_data [lindex $argv 0] [lindex $argv 1] [lindex $argv 2] [lindex $argv 3] 11 | -------------------------------------------------------------------------------- /tests/helpers/gen_write_load.tcl: -------------------------------------------------------------------------------- 1 | source tests/support/redis.tcl 2 | 3 | proc gen_write_load {host port seconds} { 4 | set start_time [clock seconds] 5 | set r [redis $host $port 1] 6 | $r select 9 7 | while 1 { 8 | $r set [expr rand()] [expr rand()] 9 | if {[clock seconds]-$start_time > $seconds} { 10 | exit 0 11 | } 12 | } 13 | } 14 | 15 | gen_write_load [lindex $argv 0] [lindex $argv 1] [lindex $argv 2] 16 | -------------------------------------------------------------------------------- /tests/integration/aof-race.tcl: -------------------------------------------------------------------------------- 1 | set defaults { appendonly {yes} appendfilename {appendonly.aof} } 2 | set server_path [tmpdir server.aof] 3 | set aof_path "$server_path/appendonly.aof" 4 | 5 | proc start_server_aof {overrides code} { 6 | upvar defaults defaults srv srv server_path server_path 7 | set config [concat $defaults $overrides] 8 | start_server [list overrides $config] $code 9 | } 10 | 11 | tags {"aof"} { 12 | # Specific test for a regression where internal buffers were not properly 13 | # cleaned after a child responsible for an AOF rewrite exited. This buffer 14 | # was subsequently appended to the new AOF, resulting in duplicate commands. 15 | start_server_aof [list dir $server_path] { 16 | set client [redis [srv host] [srv port]] 17 | set bench [open "|src/redis-benchmark -q -p [srv port] -c 20 -n 20000 incr foo" "r+"] 18 | after 100 19 | 20 | # Benchmark should be running by now: start background rewrite 21 | $client bgrewriteaof 22 | 23 | # Read until benchmark pipe reaches EOF 24 | while {[string length [read $bench]] > 0} {} 25 | 26 | # Check contents of foo 27 | assert_equal 20000 [$client get foo] 28 | } 29 | 30 | # Restart server to replay AOF 31 | start_server_aof [list dir $server_path] { 32 | set client [redis [srv host] [srv port]] 33 | assert_equal 20000 [$client get foo] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tests/integration/convert-zipmap-hash-on-load.tcl: -------------------------------------------------------------------------------- 1 | # Copy RDB with zipmap encoded hash to server path 2 | set server_path [tmpdir "server.convert-zipmap-hash-on-load"] 3 | 4 | exec cp -f tests/assets/hash-zipmap.rdb $server_path 5 | start_server [list overrides [list "dir" $server_path "dbfilename" "hash-zipmap.rdb"]] { 6 | test "RDB load zipmap hash: converts to ziplist" { 7 | r select 0 8 | 9 | assert_match "*ziplist*" [r debug object hash] 10 | assert_equal 2 [r hlen hash] 11 | assert_match {v1 v2} [r hmget hash f1 f2] 12 | } 13 | } 14 | 15 | exec cp -f tests/assets/hash-zipmap.rdb $server_path 16 | start_server [list overrides [list "dir" $server_path "dbfilename" "hash-zipmap.rdb" "hash-max-ziplist-entries" 1]] { 17 | test "RDB load zipmap hash: converts to hash table when hash-max-ziplist-entries is exceeded" { 18 | r select 0 19 | 20 | assert_match "*hashtable*" [r debug object hash] 21 | assert_equal 2 [r hlen hash] 22 | assert_match {v1 v2} [r hmget hash f1 f2] 23 | } 24 | } 25 | 26 | exec cp -f tests/assets/hash-zipmap.rdb $server_path 27 | start_server [list overrides [list "dir" $server_path "dbfilename" "hash-zipmap.rdb" "hash-max-ziplist-value" 1]] { 28 | test "RDB load zipmap hash: converts to hash table when hash-max-ziplist-value is exceeded" { 29 | r select 0 30 | 31 | assert_match "*hashtable*" [r debug object hash] 32 | assert_equal 2 [r hlen hash] 33 | assert_match {v1 v2} [r hmget hash f1 f2] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tests/integration/replication-2.tcl: -------------------------------------------------------------------------------- 1 | start_server {tags {"repl"}} { 2 | start_server {} { 3 | test {First server should have role slave after SLAVEOF} { 4 | r -1 slaveof [srv 0 host] [srv 0 port] 5 | after 1000 6 | s -1 role 7 | } {slave} 8 | 9 | test {MASTER and SLAVE dataset should be identical after complex ops} { 10 | createComplexDataset r 10000 11 | after 500 12 | if {[r debug digest] ne [r -1 debug digest]} { 13 | set csv1 [csvdump r] 14 | set csv2 [csvdump {r -1}] 15 | set fd [open /tmp/repldump1.txt w] 16 | puts -nonewline $fd $csv1 17 | close $fd 18 | set fd [open /tmp/repldump2.txt w] 19 | puts -nonewline $fd $csv2 20 | close $fd 21 | puts "Master - Slave inconsistency" 22 | puts "Run diff -u against /tmp/repldump*.txt for more info" 23 | } 24 | assert_equal [r debug digest] [r -1 debug digest] 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tests/integration/replication-3.tcl: -------------------------------------------------------------------------------- 1 | start_server {tags {"repl"}} { 2 | start_server {} { 3 | test {First server should have role slave after SLAVEOF} { 4 | r -1 slaveof [srv 0 host] [srv 0 port] 5 | after 1000 6 | s -1 role 7 | } {slave} 8 | 9 | if {$::accurate} {set numops 50000} else {set numops 5000} 10 | 11 | test {MASTER and SLAVE consistency with expire} { 12 | createComplexDataset r $numops useexpire 13 | after 4000 ;# Make sure everything expired before taking the digest 14 | r keys * ;# Force DEL syntesizing to slave 15 | after 1000 ;# Wait another second. Now everything should be fine. 16 | if {[r debug digest] ne [r -1 debug digest]} { 17 | set csv1 [csvdump r] 18 | set csv2 [csvdump {r -1}] 19 | set fd [open /tmp/repldump1.txt w] 20 | puts -nonewline $fd $csv1 21 | close $fd 22 | set fd [open /tmp/repldump2.txt w] 23 | puts -nonewline $fd $csv2 24 | close $fd 25 | puts "Master - Slave inconsistency" 26 | puts "Run diff -u against /tmp/repldump*.txt for more info" 27 | } 28 | assert_equal [r debug digest] [r -1 debug digest] 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/support/tmpfile.tcl: -------------------------------------------------------------------------------- 1 | set ::tmpcounter 0 2 | set ::tmproot "./tests/tmp" 3 | file mkdir $::tmproot 4 | 5 | # returns a dirname unique to this process to write to 6 | proc tmpdir {basename} { 7 | set dir [file join $::tmproot $basename.[pid].[incr ::tmpcounter]] 8 | file mkdir $dir 9 | set _ $dir 10 | } 11 | 12 | # return a filename unique to this process to write to 13 | proc tmpfile {basename} { 14 | file join $::tmproot $basename.[pid].[incr ::tmpcounter] 15 | } 16 | -------------------------------------------------------------------------------- /tests/unit/auth.tcl: -------------------------------------------------------------------------------- 1 | start_server {tags {"auth"}} { 2 | test {AUTH fails if there is no password configured server side} { 3 | catch {r auth foo} err 4 | set _ $err 5 | } {ERR*no password*} 6 | } 7 | 8 | start_server {tags {"auth"} overrides {requirepass foobar}} { 9 | test {AUTH fails when a wrong password is given} { 10 | catch {r auth wrong!} err 11 | set _ $err 12 | } {ERR*invalid password} 13 | 14 | test {Arbitrary command gives an error when AUTH is required} { 15 | catch {r set foo bar} err 16 | set _ $err 17 | } {ERR*operation not permitted} 18 | 19 | test {AUTH succeeds when the right password is given} { 20 | r auth foobar 21 | } {OK} 22 | 23 | test {Once AUTH succeeded we can actually send commands to the server} { 24 | r set foo 100 25 | r incr foo 26 | } {101} 27 | } 28 | -------------------------------------------------------------------------------- /tests/unit/limits.tcl: -------------------------------------------------------------------------------- 1 | start_server {tags {"limits"} overrides {maxclients 10}} { 2 | test {Check if maxclients works refusing connections} { 3 | set c 0 4 | catch { 5 | while {$c < 50} { 6 | incr c 7 | set rd [redis_deferring_client] 8 | $rd ping 9 | $rd read 10 | after 100 11 | } 12 | } e 13 | assert {$c > 8 && $c <= 10} 14 | set e 15 | } {*ERR max*reached*} 16 | } 17 | -------------------------------------------------------------------------------- /tests/unit/printver.tcl: -------------------------------------------------------------------------------- 1 | start_server {} { 2 | set i [r info] 3 | regexp {redis_version:(.*?)\r\n} $i - version 4 | regexp {redis_git_sha1:(.*?)\r\n} $i - sha1 5 | puts "Testing Redis version $version ($sha1)" 6 | } 7 | -------------------------------------------------------------------------------- /tests/unit/quit.tcl: -------------------------------------------------------------------------------- 1 | start_server {tags {"quit"}} { 2 | proc format_command {args} { 3 | set cmd "*[llength $args]\r\n" 4 | foreach a $args { 5 | append cmd "$[string length $a]\r\n$a\r\n" 6 | } 7 | set _ $cmd 8 | } 9 | 10 | test "QUIT returns OK" { 11 | reconnect 12 | assert_equal OK [r quit] 13 | assert_error * {r ping} 14 | } 15 | 16 | test "Pipelined commands after QUIT must not be executed" { 17 | reconnect 18 | r write [format_command quit] 19 | r write [format_command set foo bar] 20 | r flush 21 | assert_equal OK [r read] 22 | assert_error * {r read} 23 | 24 | reconnect 25 | assert_equal {} [r get foo] 26 | } 27 | 28 | test "Pipelined commands after QUIT that exceed read buffer size" { 29 | reconnect 30 | r write [format_command quit] 31 | r write [format_command set foo [string repeat "x" 1024]] 32 | r flush 33 | assert_equal OK [r read] 34 | assert_error * {r read} 35 | 36 | reconnect 37 | assert_equal {} [r get foo] 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/unit/type/list-2.tcl: -------------------------------------------------------------------------------- 1 | start_server { 2 | tags {"list"} 3 | overrides { 4 | "list-max-ziplist-value" 16 5 | "list-max-ziplist-entries" 256 6 | } 7 | } { 8 | source "tests/unit/type/list-common.tcl" 9 | 10 | foreach {type large} [array get largevalue] { 11 | tags {"slow"} { 12 | test "LTRIM stress testing - $type" { 13 | set mylist {} 14 | set startlen 32 15 | r del mylist 16 | 17 | # Start with the large value to ensure the 18 | # right encoding is used. 19 | r rpush mylist $large 20 | lappend mylist $large 21 | 22 | for {set i 0} {$i < $startlen} {incr i} { 23 | set str [randomInt 9223372036854775807] 24 | r rpush mylist $str 25 | lappend mylist $str 26 | } 27 | 28 | for {set i 0} {$i < 1000} {incr i} { 29 | set min [expr {int(rand()*$startlen)}] 30 | set max [expr {$min+int(rand()*$startlen)}] 31 | set mylist [lrange $mylist $min $max] 32 | r ltrim mylist $min $max 33 | assert_equal $mylist [r lrange mylist 0 -1] 34 | 35 | for {set j [r llen mylist]} {$j < $startlen} {incr j} { 36 | set str [randomInt 9223372036854775807] 37 | r rpush mylist $str 38 | lappend mylist $str 39 | } 40 | } 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/unit/type/list-common.tcl: -------------------------------------------------------------------------------- 1 | # We need a value larger than list-max-ziplist-value to make sure 2 | # the list has the right encoding when it is swapped in again. 3 | array set largevalue {} 4 | set largevalue(ziplist) "hello" 5 | set largevalue(linkedlist) [string repeat "hello" 4] 6 | -------------------------------------------------------------------------------- /utils/build-static-symbols.tcl: -------------------------------------------------------------------------------- 1 | # Build a symbol table for static symbols of redis.c 2 | # Useful to get stack traces on segfault without a debugger. See redis.c 3 | # for more information. 4 | # 5 | # Copyright(C) 2009 Salvatore Sanfilippo, under the BSD license. 6 | 7 | set fd [open redis.c] 8 | set symlist {} 9 | while {[gets $fd line] != -1} { 10 | if {[regexp {^static +[A-z0-9]+[ *]+([A-z0-9]*)\(} $line - sym]} { 11 | lappend symlist $sym 12 | } 13 | } 14 | set symlist [lsort -unique $symlist] 15 | puts "static struct redisFunctionSym symsTable\[\] = {" 16 | foreach sym $symlist { 17 | puts "{\"$sym\",(unsigned long)$sym}," 18 | } 19 | puts "{NULL,0}" 20 | puts "};" 21 | 22 | close $fd 23 | -------------------------------------------------------------------------------- /utils/mkrelease.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ $# != "1" ] 3 | then 4 | echo "Usage: ./mkrelease.sh " 5 | exit 1 6 | fi 7 | 8 | TAG=$1 9 | TARNAME="redis-${TAG}.tar" 10 | echo "Generating /tmp/${TARNAME}" 11 | git archive $TAG --prefix redis-${TAG}/ > /tmp/$TARNAME || exit 1 12 | echo "Gizipping the archive" 13 | rm -f /tmp/$TARNAME.gz 14 | gzip -9 /tmp/$TARNAME 15 | -------------------------------------------------------------------------------- /utils/redis_init_script: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Simple Redis init.d script conceived to work on Linux systems 4 | # as it does use of the /proc filesystem. 5 | 6 | REDISPORT=6379 7 | EXEC=/usr/local/bin/redis-server 8 | CLIEXEC=/usr/local/bin/redis-cli 9 | 10 | PIDFILE=/var/run/redis_${REDISPORT}.pid 11 | CONF="/etc/redis/${REDISPORT}.conf" 12 | 13 | case "$1" in 14 | start) 15 | if [ -f $PIDFILE ] 16 | then 17 | echo "$PIDFILE exists, process is already running or crashed" 18 | else 19 | echo "Starting Redis server..." 20 | $EXEC $CONF 21 | fi 22 | ;; 23 | stop) 24 | if [ ! -f $PIDFILE ] 25 | then 26 | echo "$PIDFILE does not exist, process is not running" 27 | else 28 | PID=$(cat $PIDFILE) 29 | echo "Stopping ..." 30 | $CLIEXEC -p $REDISPORT shutdown 31 | while [ -x /proc/${PID} ] 32 | do 33 | echo "Waiting for Redis to shutdown ..." 34 | sleep 1 35 | done 36 | echo "Redis stopped" 37 | fi 38 | ;; 39 | *) 40 | echo "Please use start or stop as first argument" 41 | ;; 42 | esac 43 | -------------------------------------------------------------------------------- /utils/redis_init_script.tpl: -------------------------------------------------------------------------------- 1 | 2 | case "$1" in 3 | start) 4 | if [ -f $PIDFILE ] 5 | then 6 | echo "$PIDFILE exists, process is already running or crashed" 7 | else 8 | echo "Starting Redis server..." 9 | $EXEC $CONF 10 | fi 11 | ;; 12 | stop) 13 | if [ ! -f $PIDFILE ] 14 | then 15 | echo "$PIDFILE does not exist, process is not running" 16 | else 17 | PID=$(cat $PIDFILE) 18 | echo "Stopping ..." 19 | $CLIEXEC -p $REDISPORT shutdown 20 | while [ -x /proc/${PID} ] 21 | do 22 | echo "Waiting for Redis to shutdown ..." 23 | sleep 1 24 | done 25 | echo "Redis stopped" 26 | fi 27 | ;; 28 | *) 29 | echo "Please use start or stop as first argument" 30 | ;; 31 | esac 32 | -------------------------------------------------------------------------------- /utils/whatisdoing.sh: -------------------------------------------------------------------------------- 1 | # This script is from http://poormansprofiler.org/ 2 | 3 | #!/bin/bash 4 | nsamples=1 5 | sleeptime=0 6 | pid=$(pidof redis-server) 7 | 8 | for x in $(seq 1 $nsamples) 9 | do 10 | gdb -ex "set pagination 0" -ex "thread apply all bt" -batch -p $pid 11 | sleep $sleeptime 12 | done | \ 13 | awk ' 14 | BEGIN { s = ""; } 15 | /Thread/ { print s; s = ""; } 16 | /^\#/ { if (s != "" ) { s = s "," $4} else { s = $4 } } 17 | END { print s }' | \ 18 | sort | uniq -c | sort -r -n -k 1,1 19 | --------------------------------------------------------------------------------