| Index: third_party/protobuf/ruby/src/main/java/google/ProtobufJavaService.java
|
| diff --git a/third_party/tcmalloc/vendor/src/base/synchronization_profiling.h b/third_party/protobuf/ruby/src/main/java/google/ProtobufJavaService.java
|
| similarity index 54%
|
| copy from third_party/tcmalloc/vendor/src/base/synchronization_profiling.h
|
| copy to third_party/protobuf/ruby/src/main/java/google/ProtobufJavaService.java
|
| index cf02c218a111806189f71f7b528a83b5ceb164a4..bffb492a9e27070e7907817f42daad58cf9a3d8f 100644
|
| --- a/third_party/tcmalloc/vendor/src/base/synchronization_profiling.h
|
| +++ b/third_party/protobuf/ruby/src/main/java/google/ProtobufJavaService.java
|
| @@ -1,5 +1,7 @@
|
| -/* Copyright (c) 2010, Google Inc.
|
| - * All rights reserved.
|
| +/*
|
| + * Protocol Buffers - Google's data interchange format
|
| + * Copyright 2014 Google Inc. All rights reserved.
|
| + * https://developers.google.com/protocol-buffers/
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions are
|
| @@ -26,25 +28,33 @@
|
| * 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.
|
| - *
|
| - * ---
|
| - * Author: Chris Ruemmler
|
| */
|
|
|
| -#ifndef BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_
|
| -#define BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_
|
| -
|
| -#include "base/basictypes.h"
|
| +package google;
|
|
|
| -namespace base {
|
| +import com.google.protobuf.jruby.*;
|
| +import org.jruby.Ruby;
|
| +import org.jruby.runtime.load.BasicLibraryService;
|
|
|
| -// We can do contention-profiling of SpinLocks, but the code is in
|
| -// mutex.cc, which is not always linked in with spinlock. Hence we
|
| -// provide a weak definition, which are used if mutex.cc isn't linked in.
|
| +import java.io.IOException;
|
|
|
| -// Submit the number of cycles the spinlock spent contending.
|
| -ATTRIBUTE_WEAK extern void SubmitSpinLockProfileData(const void *, int64);
|
| -extern void SubmitSpinLockProfileData(const void *contendedlock,
|
| - int64 wait_cycles) {}
|
| +public class ProtobufJavaService implements BasicLibraryService {
|
| + @Override
|
| + public boolean basicLoad(Ruby ruby) throws IOException {
|
| + ruby.defineModule("Google");
|
| + RubyProtobuf.createProtobuf(ruby);
|
| + RubyDescriptor.createRubyDescriptor(ruby);
|
| + RubyBuilder.createRubyBuilder(ruby);
|
| + RubyFieldDescriptor.createRubyFileDescriptor(ruby);
|
| + RubyMessageBuilderContext.createRubyMessageBuilderContext(ruby);
|
| + RubyEnumDescriptor.createRubyEnumDescriptor(ruby);
|
| + RubyEnumBuilderContext.createRubyEnumBuilderContext(ruby);
|
| + RubyDescriptorPool.createRubyDescriptorPool(ruby);
|
| + RubyRepeatedField.createRubyRepeatedField(ruby);
|
| + RubyFieldDescriptor.createRubyFileDescriptor(ruby);
|
| + RubyMap.createRubyMap(ruby);
|
| + RubyOneofDescriptor.createRubyOneofDescriptor(ruby);
|
| + RubyOneofBuilderContext.createRubyOneofBuilderContext(ruby);
|
| + return true;
|
| + }
|
| }
|
| -#endif // BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_
|
|
|