summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2016-02-16 17:46:18 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2016-02-16 17:47:25 -0800
commit82a3082d643e2bf8da91bb178fa639eb494be4d6 (patch)
tree4ef3e9aa54cf1708d5a7f0debe808b9a96a123ca
parentec62791d8c815cdeaf9fe0889787111d58e3535e (diff)
downloadnasm-82a3082d643e2bf8da91bb178fa639eb494be4d6.tar.gz
raa: move private parts of the implementation into raa.c
Move the private aspects of the implementation into raa.c instead of exposing it to raa.h. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--raa.c45
-rw-r--r--raa.h45
2 files changed, 46 insertions, 44 deletions
diff --git a/raa.c b/raa.c
index be912a40..a9ed830b 100644
--- a/raa.c
+++ b/raa.c
@@ -34,6 +34,51 @@
#include "nasmlib.h"
#include "raa.h"
+/*
+ * Routines to manage a dynamic random access array of int64_ts which
+ * may grow in size to be more than the largest single malloc'able
+ * chunk.
+ */
+
+#define RAA_BLKSHIFT 15 /* 2**this many longs allocated at once */
+#define RAA_BLKSIZE (1 << RAA_BLKSHIFT)
+#define RAA_LAYERSHIFT 15 /* 2**this many _pointers_ allocated */
+#define RAA_LAYERSIZE (1 << RAA_LAYERSHIFT)
+
+typedef struct RAA RAA;
+typedef union RAA_UNION RAA_UNION;
+typedef struct RAA_LEAF RAA_LEAF;
+typedef struct RAA_BRANCH RAA_BRANCH;
+
+struct RAA {
+ /*
+ * Number of layers below this one to get to the real data. 0
+ * means this structure is a leaf, holding RAA_BLKSIZE real
+ * data items; 1 and above mean it's a branch, holding
+ * RAA_LAYERSIZE pointers to the next level branch or leaf
+ * structures.
+ */
+ int layers;
+
+ /*
+ * Number of real data items spanned by one position in the
+ * `data' array at this level. This number is 0 trivially, for
+ * a leaf (level 0): for a level 1 branch it should be
+ * RAA_BLKSHIFT, and for a level 2 branch it's
+ * RAA_LAYERSHIFT+RAA_BLKSHIFT.
+ */
+ int shift;
+
+ union RAA_UNION {
+ struct RAA_LEAF {
+ int64_t data[RAA_BLKSIZE];
+ } l;
+ struct RAA_BRANCH {
+ struct RAA *data[RAA_LAYERSIZE];
+ } b;
+ } u;
+};
+
#define LEAFSIZ (sizeof(RAA)-sizeof(RAA_UNION)+sizeof(RAA_LEAF))
#define BRANCHSIZ (sizeof(RAA)-sizeof(RAA_UNION)+sizeof(RAA_BRANCH))
diff --git a/raa.h b/raa.h
index d47f84ce..22c4537b 100644
--- a/raa.h
+++ b/raa.h
@@ -36,50 +36,7 @@
#include "compiler.h"
-/*
- * Routines to manage a dynamic random access array of int64_ts which
- * may grow in size to be more than the largest single malloc'able
- * chunk.
- */
-
-#define RAA_BLKSHIFT 15 /* 2**this many longs allocated at once */
-#define RAA_BLKSIZE (1 << RAA_BLKSHIFT)
-#define RAA_LAYERSHIFT 15 /* 2**this many _pointers_ allocated */
-#define RAA_LAYERSIZE (1 << RAA_LAYERSHIFT)
-
-typedef struct RAA RAA;
-typedef union RAA_UNION RAA_UNION;
-typedef struct RAA_LEAF RAA_LEAF;
-typedef struct RAA_BRANCH RAA_BRANCH;
-
-struct RAA {
- /*
- * Number of layers below this one to get to the real data. 0
- * means this structure is a leaf, holding RAA_BLKSIZE real
- * data items; 1 and above mean it's a branch, holding
- * RAA_LAYERSIZE pointers to the next level branch or leaf
- * structures.
- */
- int layers;
-
- /*
- * Number of real data items spanned by one position in the
- * `data' array at this level. This number is 0 trivially, for
- * a leaf (level 0): for a level 1 branch it should be
- * RAA_BLKSHIFT, and for a level 2 branch it's
- * RAA_LAYERSHIFT+RAA_BLKSHIFT.
- */
- int shift;
-
- union RAA_UNION {
- struct RAA_LEAF {
- int64_t data[RAA_BLKSIZE];
- } l;
- struct RAA_BRANCH {
- struct RAA *data[RAA_LAYERSIZE];
- } b;
- } u;
-};
+struct RAA;
struct RAA *raa_init(void);
void raa_free(struct RAA *);