1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /* Copyright (c) 2011 Facebook
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHORS BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #include "include/buffer.h"
22 namespace PerfHelper {
24 /// Flush the CPU data cache by reading and writing 100MB of new data.
27 int hundredMegs = 100 * 1024 * 1024;
28 volatile char* block = new char[hundredMegs];
29 for (int i = 0; i < hundredMegs; i++)
34 /// Used in functionCall().
35 uint64_t plus_one(uint64_t x)
40 /// Used in throwIntNL.
46 /// Used in throwExceptionNL.
47 void throw_end_of_buffer()
49 throw buffer::end_of_buffer();