summaryrefslogtreecommitdiff
path: root/examples/Shared_Malloc/test_multiple_mallocs.cpp
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-01 08:00:34 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-01 08:00:34 +0000
commit437eea6fa08e931864f89be91d14a816f69075c7 (patch)
treeb8c1fd723fdcd61c3855d3a3a21a9cd45a268219 /examples/Shared_Malloc/test_multiple_mallocs.cpp
parentea0d28240863caf437a18071bfd03e7b146c5ade (diff)
downloadATCD-unlabeled-4.2.2.tar.gz
This commit was manufactured by cvs2svn to create branchunlabeled-4.2.2
'unlabeled-4.2.2'.
Diffstat (limited to 'examples/Shared_Malloc/test_multiple_mallocs.cpp')
-rw-r--r--examples/Shared_Malloc/test_multiple_mallocs.cpp59
1 files changed, 0 insertions, 59 deletions
diff --git a/examples/Shared_Malloc/test_multiple_mallocs.cpp b/examples/Shared_Malloc/test_multiple_mallocs.cpp
deleted file mode 100644
index e4d769a93e6..00000000000
--- a/examples/Shared_Malloc/test_multiple_mallocs.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-// $Id$
-
-// Test the capabilities of the ACE shared memory manager in terms of
-// its ability to handle multiple mallocs rooted at different base
-// addresses.
-
-#include "ace/Malloc.h"
-#include "ace/Synch.h"
-
-typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex> MALLOC;
-
-// Default address for shared memory mapped files and SYSV shared
-// memory (defaults to 64 M).
-void *REQUEST_BASE_ADDR = ((void *) (64 * 1024 * 1024));
-const char *REQUEST_STRING = "hello from request repository";
-
-// Default address for shared memory mapped files and SYSV shared
-// memory (defaults to 64 M).
-void *RESPONSE_BASE_ADDR = ((void *) (128 * 1024 * 1024));
-const char *RESPONSE_STRING = "hello from response repository";
-
-int
-main (void)
-{
- ACE_MMAP_Memory_Pool_Options request_options (REQUEST_BASE_ADDR);
-
- // Create an adapter version of an allocator.
- ACE_Allocator_Adapter<MALLOC> *shmem_request =
- new ACE_Allocator_Adapter<MALLOC> ("request_file", "RequestLock", &request_options);
-
- ACE_MMAP_Memory_Pool_Options response_options (RESPONSE_BASE_ADDR);
-
- // Create a non-adapter version of an allocator.
- MALLOC *shmem_response =
- new MALLOC ("response_file","ResponseLock", &response_options);
-
- void *data = 0;
-
- if (shmem_request->find ("foo", data) == 0)
- cout << (char *) data << endl;
- else
- {
- data = shmem_request->malloc (ACE_OS::strlen (REQUEST_STRING) + 1);
- ACE_OS::strcpy ((char *) data, REQUEST_STRING);
- shmem_request->bind ("foo", data);
- }
- data = 0;
-
- if (shmem_response->find ("foo", data) == 0)
- cout << (char *) data << endl;
- else
- {
- data = shmem_response->malloc (ACE_OS::strlen (RESPONSE_STRING) + 1);
- ACE_OS::strcpy ((char *) data, RESPONSE_STRING);
- shmem_response->bind ("foo", data);
- }
-
- return 0;
-}