Changeset: cc098c48aed8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cc098c48aed8
Removed Files:
gdk/gdk_strimps.h
Modified Files:
gdk/CMakeLists.txt
gdk/gdk_strimps.c
Branch: strimps-updates
Log Message:
No need for gdk_strimps.h anymore
gdk_strimps.c does not export publicly any functions
diffs (122 lines):
diff --git a/gdk/CMakeLists.txt b/gdk/CMakeLists.txt
--- a/gdk/CMakeLists.txt
+++ b/gdk/CMakeLists.txt
@@ -90,7 +90,7 @@ target_sources(bat
gdk_analytic.h
gdk_tracer.c gdk_tracer.h
gdk_rtree.c
- gdk_strimps.c gdk_strimps.h
+ gdk_strimps.c
PUBLIC
${gdk_public_headers})
diff --git a/gdk/gdk_strimps.c b/gdk/gdk_strimps.c
--- a/gdk/gdk_strimps.c
+++ b/gdk/gdk_strimps.c
@@ -85,7 +85,38 @@
#include "gdk.h"
#include "gdk_private.h"
-#include "gdk_strimps.h"
+#include <stdint.h>
+
+
+#define STRIMP_VERSION (uint64_t)2
+#define STRIMP_HISTSIZE (256*256)
+#define STRIMP_HEADER_SIZE 64
+#define STRIMP_PAIRS (STRIMP_HEADER_SIZE - 1)
+#define STRIMP_CREATION_THRESHOLD \
+ ((BUN) ((ATOMIC_GET(&GDKdebug) & FORCEMITOMASK)? 100 : 5000))
+
+typedef struct {
+#ifdef UTF8STRIMPS
+ uint8_t *pbytes;
+#else
+ uint8_t pbytes[2];
+#endif //UTF8STRIMPSX
+ uint8_t psize;
+ size_t idx;
+ uint64_t mask;
+} CharPair;
+
+typedef struct {
+ size_t pos;
+ size_t lim;
+ const char *s;
+} PairIterator;
+
+typedef struct {
+ uint64_t cnt;
+ uint64_t mask;
+ size_t idx;
+} PairHistogramElem;
/* Macros for accessing metadada of a strimp. These are recorded in the
@@ -138,17 +169,6 @@ histogram_index(PairHistogramElem *hist,
return pairToIndex(p->pbytes[0], p->pbytes[1]);
}
-inline static uint8_t *
-histindex2bytes(size_t index, uint8_t *psize)
-{
- *psize = 2;
- uint8_t *ret = (uint8_t *)malloc(*psize*sizeof(uint8_t));
- ret[1] = (uint8_t)(index & 0xFFFF);
- ret[0] = (uint8_t)((index >> 8) & 0xFFFF);
-
- return ret;
-}
-
inline static size_t
bytes2histindex(uint8_t *bytes, uint8_t psize) {
(void)psize;
diff --git a/gdk/gdk_strimps.h b/gdk/gdk_strimps.h
deleted file mode 100644
--- a/gdk/gdk_strimps.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V.
- */
-
-#ifndef _GDK_STRIMPS_H_
-#define _GDK_STRIMPS_H_
-
-#include <stdint.h>
-
-
-#define STRIMP_VERSION (uint64_t)2
-#define STRIMP_HISTSIZE (256*256)
-#define STRIMP_HEADER_SIZE 64
-#define STRIMP_PAIRS (STRIMP_HEADER_SIZE - 1)
-#define STRIMP_CREATION_THRESHOLD \
- ((BUN) ((ATOMIC_GET(&GDKdebug) & FORCEMITOMASK)? 100 : 5000))
-
-typedef struct {
- uint8_t *pbytes;
- uint8_t psize;
- size_t idx;
- uint64_t mask;
-} CharPair;
-
-typedef struct {
- size_t pos;
- size_t lim;
- const char *s;
-} PairIterator;
-
-typedef struct {
- uint64_t cnt;
- uint64_t mask;
- size_t idx;
-} PairHistogramElem;
-
-
-#endif /* _GDK_STRIMPS_H_ */
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]