Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: source/test/perf/usetperf/bitset.cpp

Issue 2435373002: Delete source/test (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/test/perf/usetperf/bitset.h ('k') | source/test/perf/usetperf/usetperf.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/perf/usetperf/bitset.cpp
diff --git a/source/test/perf/usetperf/bitset.cpp b/source/test/perf/usetperf/bitset.cpp
deleted file mode 100644
index ea5f11b8b2febe5e2605227617da999d15170b7e..0000000000000000000000000000000000000000
--- a/source/test/perf/usetperf/bitset.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-**********************************************************************
-* Copyright (c) 2002-2005, International Business Machines
-* Corporation and others. All Rights Reserved.
-**********************************************************************
-* 2002-09-20 aliu Created.
-*/
-
-#include "unicode/utypes.h"
-#include "cmemory.h"
-#include "bitset.h"
-
-// TODO: have a separate capacity, so the len can just be set to
-// zero in the clearAll() method, and growth can be smarter.
-
-const int32_t SLOP = 8;
-
-const int32_t BYTES_PER_WORD = sizeof(int32_t);
-
-BitSet::BitSet() {
- len = SLOP;
- data = (int32_t*) uprv_malloc(len * BYTES_PER_WORD);
- clearAll();
-}
-
-BitSet::~BitSet() {
- uprv_free(data);
-}
-
-UBool BitSet::get(int32_t bitIndex) const {
- uint32_t longIndex = bitIndex >> 5;
- int32_t bitInLong = bitIndex & 0x1F;
- return (longIndex < len) ? (((data[longIndex] >> bitInLong) & 1) != 0)
- : FALSE;
-}
-
-void BitSet::set(int32_t bitIndex) {
- uint32_t longIndex = bitIndex >> 5;
- int32_t bitInLong = bitIndex & 0x1F;
- if (longIndex >= len) {
- ensureCapacity(longIndex+1);
- }
- data[longIndex] |= (1 << bitInLong);
-}
-
-void BitSet::clearAll() {
- for (uint32_t i=0; i<len; ++i) data[i] = 0;
-}
-
-void BitSet::ensureCapacity(uint32_t minLen) {
- uint32_t newLen = len;
- while (newLen < minLen) newLen <<= 1; // grow exponentially
- int32_t* newData = (int32_t*) uprv_malloc(newLen * BYTES_PER_WORD);
- uprv_memcpy(newData, data, len * BYTES_PER_WORD);
- uprv_free(data);
- data = newData;
- int32_t* p = data + len;
- int32_t* limit = data + newLen;
- while (p < limit) *p++ = 0;
- len = newLen;
-}
-
-//eof
« no previous file with comments | « source/test/perf/usetperf/bitset.h ('k') | source/test/perf/usetperf/usetperf.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698