summaryrefslogtreecommitdiff
path: root/examples/Shared_Malloc
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-02-13 17:24:28 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-02-13 17:24:28 +0000
commit4ed51cec3bcaea754dfc6ce40579dd2b3b114a4e (patch)
treef64a0702b54c93723d1f56c02c15a3158c3e1ee2 /examples/Shared_Malloc
parenta31b177662785fa6dfa7716b4fc8aa97c4aece80 (diff)
downloadATCD-4ed51cec3bcaea754dfc6ce40579dd2b3b114a4e.tar.gz
ChangeLogTag:Sun Feb 13 11:17:33 2000 Nanbor Wang <nanbor@cs.wustl.edu>
Diffstat (limited to 'examples/Shared_Malloc')
-rw-r--r--examples/Shared_Malloc/test_multiple_mallocs.cpp12
-rw-r--r--examples/Shared_Malloc/test_position_independent_malloc.cpp12
2 files changed, 12 insertions, 12 deletions
diff --git a/examples/Shared_Malloc/test_multiple_mallocs.cpp b/examples/Shared_Malloc/test_multiple_mallocs.cpp
index 1d19a6a5bda..722ad276fd1 100644
--- a/examples/Shared_Malloc/test_multiple_mallocs.cpp
+++ b/examples/Shared_Malloc/test_multiple_mallocs.cpp
@@ -9,9 +9,9 @@
ACE_RCSID(Shared_Malloc, test_multiple_mallocs, "$Id$")
-typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex> MALLOC;
+typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex> MALLOC;
-#if defined (ACE_HAS_POSITION_INDEPENDENT_MALLOC)
+#if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1)
// The Address for the shared memory mapped files defaults to wherever
// the OS wants to map it.
const void *REQUEST_BASE_ADDR = 0;
@@ -24,12 +24,12 @@ const void *REQUEST_BASE_ADDR = ((void *) (64 * 1024 * 1024));
// Default address for shared memory mapped files and SYSV shared
// memory (defaults to 64 M).
const void *RESPONSE_BASE_ADDR = ((void *) (128 * 1024 * 1024));
-#endif /* ACE_HAS_POSITION_INDEPENDENT_MALLOC */
+#endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */
static const char *request_string = "hello from request repository";
static const char *response_string = "hello from response repository";
-int
+int
main (int, char *[])
{
ACE_MMAP_Memory_Pool_Options request_options (REQUEST_BASE_ADDR);
@@ -53,14 +53,14 @@ main (int, char *[])
&response_options),
1);
auto_ptr <MALLOC> shmem_response (ptr);
- void *data = 0;
+ void *data = 0;
// If we find "foo" then we're running the "second" time, so we must
// release the resources.
if (shmem_request->find ("foo",
data) == 0)
{
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"%s\n",
data));
shmem_request->remove ();
diff --git a/examples/Shared_Malloc/test_position_independent_malloc.cpp b/examples/Shared_Malloc/test_position_independent_malloc.cpp
index 757f69d1a1d..3eb5934c5ef 100644
--- a/examples/Shared_Malloc/test_position_independent_malloc.cpp
+++ b/examples/Shared_Malloc/test_position_independent_malloc.cpp
@@ -14,11 +14,11 @@
ACE_RCSID(Shared_Malloc, test_multiple_mallocs, "$Id$")
-#if defined (ACE_HAS_POSITION_INDEPENDENT_MALLOC)
+#if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1)
typedef ACE_PI_Control_Block CONTROL_BLOCK;
#else
typedef ACE_Control_Block CONTROL_BLOCK;
-#endif /* ACE_HAS_POSITION_INDEPENDENT_MALLOC */
+#endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */
typedef ACE_Malloc_T <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex, CONTROL_BLOCK> MALLOC;
@@ -192,9 +192,9 @@ template class ACE_Based_Pointer_Basic<Long_Test>;
template class ACE_Based_Pointer<Long_Test>;
template class auto_ptr <MALLOC>;
template class ACE_Auto_Basic_Ptr<MALLOC>;
-#if defined (ACE_HAS_POSITION_INDEPENDENT_MALLOC)
+#if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1)
template class ACE_Malloc_T <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex, CONTROL_BLOCK>;
-#endif /* ACE_HAS_POSITION_INDEPENDENT_MALLOC */
+#endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate ACE_Based_Pointer<Test_Data>
#pragma instantiate ACE_Based_Pointer_Basic<Test_Data>
@@ -203,7 +203,7 @@ template class ACE_Malloc_T <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex, CONTROL_BL
#pragma instantiate ACE_Based_Pointer_Basic<Long>
#pragma instantiate auto_ptr <MALLOC>
#pragma instantiate ACE_Auto_Basic_Ptr<MALLOC>
-#if defined (ACE_HAS_POSITION_INDEPENDENT_MALLOC)
+#if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1)
#pragma instantiate ACE_Malloc_T <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex, CONTROL_BLOCK>
-#endif /* ACE_HAS_POSITION_INDEPENDENT_MALLOC */
+#endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */