/*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
SimpleRetT findInternal(const KeyT k) const;
- SimpleRetT findAtInternal(const uint32_t idx) const;
+ SimpleRetT findAtInternal(uint32_t idx) const;
std::atomic<SubMap*> subMaps_[kNumSubMaps_];
std::atomic<uint32_t> numMapsAllocated_;
/*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#ifndef FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACER_H_
#define FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACER_H_
-#include <vector>
#include <iostream>
+#include <typeinfo>
+#include <vector>
namespace folly {
namespace exception_tracer {
/*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
-
#include <dlfcn.h>
#include <pthread.h>
#include <stdlib.h>
pthread_once_t initialized = PTHREAD_ONCE_INIT;
extern "C" {
-typedef void (*CxaThrowType)(void*, std::type_info*, void (*)(void));
+typedef void (*CxaThrowType)(void*, std::type_info*, void (*)(void))
+ __attribute__((noreturn));
typedef void* (*CxaBeginCatchType)(void*);
-typedef void (*CxaRethrowType)(void);
+typedef void (*CxaRethrowType)(void)
+ __attribute__((noreturn));
typedef void (*CxaEndCatchType)(void);
-CxaThrowType orig_cxa_throw __attribute__((noreturn));
+CxaThrowType orig_cxa_throw;
CxaBeginCatchType orig_cxa_begin_catch;
-CxaRethrowType orig_cxa_rethrow __attribute__((noreturn));
+CxaRethrowType orig_cxa_rethrow;
CxaEndCatchType orig_cxa_end_catch;
} // extern "C"
-typedef void (*RethrowExceptionType)(std::exception_ptr);
-RethrowExceptionType orig_rethrow_exception __attribute__((noreturn));
+typedef void (*RethrowExceptionType)(std::exception_ptr)
+ __attribute__((noreturn));
+RethrowExceptionType orig_rethrow_exception;
void initialize() {
orig_cxa_throw = (CxaThrowType)dlsym(RTLD_NEXT, "__cxa_throw");
/*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
TEST(Gen, MinBy) {
EXPECT_EQ(7, seq(1, 10)
- | minBy([](int i) {
- auto d = i - 6.8;
+ | minBy([](int i) -> double {
+ double d = i - 6.8;
return d * d;
}));
}
/*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// @author Nicholas Ormrod <njormrod@fb.com>
#include "folly/DynamicConverter.h"
+
+#include <algorithm>
#include <gtest/gtest.h>
#include <gflags/gflags.h>
#include "folly/Benchmark.h"
TEST(DynamicConverter, map_to_vector_of_pairs) {
dynamic d1 = dynamic::object("1", "one")("2", "two");
auto i1 = convertTo<std::vector<std::pair<std::string, std::string>>>(d1);
+ std::sort(i1.begin(), i1.end());
decltype(i1) i1b = { { "1", "one" }, { "2", "two" } };
EXPECT_EQ(i1, i1b);
}