aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-12-16 02:22:58 +0000
committerlloyd <[email protected]>2009-12-16 02:22:58 +0000
commit12afeca214c4414a0ced0bc4654d0fc5908dc77b (patch)
treed0706f470d406d68b4ec1f559d2e0f6426174c28 /src/alloc
parent87cbaef441c6baba2699a8ea53ac2562c46c772d (diff)
Make many more headers internal-only.
Fixes for the amalgamation generator for internal headers. Remove BOTAN_DLL exporting macros from all internal-only headers; the classes/functions there don't need to be exported, and avoiding the PIC/GOT indirection can be a big win. Add missing BOTAN_DLLs where necessary, mostly gfpmath and cvc For GCC, use -fvisibility=hidden and set BOTAN_DLL to the visibility __attribute__ to export those classes/functions.
Diffstat (limited to 'src/alloc')
-rw-r--r--src/alloc/alloc_mmap/info.txt8
-rw-r--r--src/alloc/alloc_mmap/mmap_mem.cpp4
-rw-r--r--src/alloc/alloc_mmap/mmap_mem.h4
-rw-r--r--src/alloc/mem_pool/info.txt9
-rw-r--r--src/alloc/mem_pool/mem_pool.cpp4
-rw-r--r--src/alloc/mem_pool/mem_pool.h6
-rw-r--r--src/alloc/system_alloc/defalloc.cpp4
-rw-r--r--src/alloc/system_alloc/defalloc.h6
-rw-r--r--src/alloc/system_alloc/info.txt9
9 files changed, 39 insertions, 15 deletions
diff --git a/src/alloc/alloc_mmap/info.txt b/src/alloc/alloc_mmap/info.txt
index 8ecb4df13..562277a37 100644
--- a/src/alloc/alloc_mmap/info.txt
+++ b/src/alloc/alloc_mmap/info.txt
@@ -1,6 +1,12 @@
define ALLOC_MMAP
-load_on auto
+<source>
+mmap_mem.cpp
+</source>
+
+<header:internal>
+mmap_mem.h
+</header:internal>
<os>
linux
diff --git a/src/alloc/alloc_mmap/mmap_mem.cpp b/src/alloc/alloc_mmap/mmap_mem.cpp
index 546da7a81..4a7019ae7 100644
--- a/src/alloc/alloc_mmap/mmap_mem.cpp
+++ b/src/alloc/alloc_mmap/mmap_mem.cpp
@@ -5,7 +5,7 @@
* Distributed under the terms of the Botan license
*/
-#include <botan/mmap_mem.h>
+#include <botan/internal/mmap_mem.h>
#include <cstring>
#include <sys/types.h>
@@ -26,7 +26,7 @@ namespace {
/*
* MemoryMapping_Allocator Exception
*/
-class MemoryMapping_Failed : public Exception
+class BOTAN_DLL MemoryMapping_Failed : public Exception
{
public:
MemoryMapping_Failed(const std::string& msg) :
diff --git a/src/alloc/alloc_mmap/mmap_mem.h b/src/alloc/alloc_mmap/mmap_mem.h
index bef166a16..da3dda31d 100644
--- a/src/alloc/alloc_mmap/mmap_mem.h
+++ b/src/alloc/alloc_mmap/mmap_mem.h
@@ -8,14 +8,14 @@
#ifndef BOTAN_MMAP_ALLOCATOR_H__
#define BOTAN_MMAP_ALLOCATOR_H__
-#include <botan/mem_pool.h>
+#include <botan/internal/mem_pool.h>
namespace Botan {
/*
* Memory Mapping Allocator
*/
-class BOTAN_DLL MemoryMapping_Allocator : public Pooling_Allocator
+class MemoryMapping_Allocator : public Pooling_Allocator
{
public:
MemoryMapping_Allocator(Mutex* m) : Pooling_Allocator(m) {}
diff --git a/src/alloc/mem_pool/info.txt b/src/alloc/mem_pool/info.txt
index 6cb221834..5097c325f 100644
--- a/src/alloc/mem_pool/info.txt
+++ b/src/alloc/mem_pool/info.txt
@@ -1,3 +1,12 @@
+
+<source>
+mem_pool.cpp
+</source>
+
+<header:internal>
+mem_pool.h
+</header:internal>
+
<requires>
mutex
</requires>
diff --git a/src/alloc/mem_pool/mem_pool.cpp b/src/alloc/mem_pool/mem_pool.cpp
index e30a7b98a..2945a4cef 100644
--- a/src/alloc/mem_pool/mem_pool.cpp
+++ b/src/alloc/mem_pool/mem_pool.cpp
@@ -7,8 +7,8 @@
* Distributed under the terms of the Botan license
*/
-#include <botan/mem_pool.h>
-#include <botan/rounding.h>
+#include <botan/internal/mem_pool.h>
+#include <botan/internal/rounding.h>
#include <botan/mem_ops.h>
#include <algorithm>
#include <exception>
diff --git a/src/alloc/mem_pool/mem_pool.h b/src/alloc/mem_pool/mem_pool.h
index 51571405e..9735a547d 100644
--- a/src/alloc/mem_pool/mem_pool.h
+++ b/src/alloc/mem_pool/mem_pool.h
@@ -10,7 +10,7 @@
#include <botan/allocate.h>
#include <botan/exceptn.h>
-#include <botan/mutex.h>
+#include <botan/internal/mutex.h>
#include <utility>
#include <vector>
@@ -19,7 +19,7 @@ namespace Botan {
/*
* Pooling Allocator
*/
-class BOTAN_DLL Pooling_Allocator : public Allocator
+class Pooling_Allocator : public Allocator
{
public:
void* allocate(u32bit);
@@ -36,7 +36,7 @@ class BOTAN_DLL Pooling_Allocator : public Allocator
virtual void* alloc_block(u32bit) = 0;
virtual void dealloc_block(void*, u32bit) = 0;
- class BOTAN_DLL Memory_Block
+ class Memory_Block
{
public:
Memory_Block(void*);
diff --git a/src/alloc/system_alloc/defalloc.cpp b/src/alloc/system_alloc/defalloc.cpp
index b1b338d71..faaeb3c58 100644
--- a/src/alloc/system_alloc/defalloc.cpp
+++ b/src/alloc/system_alloc/defalloc.cpp
@@ -5,9 +5,9 @@
* Distributed under the terms of the Botan license
*/
-#include <botan/defalloc.h>
+#include <botan/internal/defalloc.h>
+#include <botan/internal/mlock.h>
#include <botan/libstate.h>
-#include <botan/mlock.h>
#include <cstdlib>
#include <cstring>
diff --git a/src/alloc/system_alloc/defalloc.h b/src/alloc/system_alloc/defalloc.h
index 627e8df70..0c8804223 100644
--- a/src/alloc/system_alloc/defalloc.h
+++ b/src/alloc/system_alloc/defalloc.h
@@ -8,14 +8,14 @@
#ifndef BOTAN_BASIC_ALLOC_H__
#define BOTAN_BASIC_ALLOC_H__
-#include <botan/mem_pool.h>
+#include <botan/internal/mem_pool.h>
namespace Botan {
/*
* Malloc Allocator
*/
-class BOTAN_DLL Malloc_Allocator : public Allocator
+class Malloc_Allocator : public Allocator
{
public:
void* allocate(u32bit);
@@ -27,7 +27,7 @@ class BOTAN_DLL Malloc_Allocator : public Allocator
/*
* Locking Allocator
*/
-class BOTAN_DLL Locking_Allocator : public Pooling_Allocator
+class Locking_Allocator : public Pooling_Allocator
{
public:
Locking_Allocator(Mutex* m) : Pooling_Allocator(m) {}
diff --git a/src/alloc/system_alloc/info.txt b/src/alloc/system_alloc/info.txt
index 8826440d4..87de0cb67 100644
--- a/src/alloc/system_alloc/info.txt
+++ b/src/alloc/system_alloc/info.txt
@@ -1,3 +1,12 @@
+
+<source>
+defalloc.cpp
+</source>
+
+<header:internal>
+defalloc.h
+</header:internal>
+
<requires>
libstate
mem_pool