diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-12-03 00:06:36 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-12-03 00:06:36 +0000 |
commit | 783f9634c13a4e51e77db9dd376df5fce1140087 (patch) | |
tree | d128af9aaf93acd3c0ccd2e73916e0ea6c4cd6de /tests/Malloc_Test.cpp | |
parent | abaf271c6378ae9fc013cd8ef47744d7881abbda (diff) | |
download | ATCD-783f9634c13a4e51e77db9dd376df5fce1140087.tar.gz |
ChangeLogTag:Thu Dec 02 18:03:27 1999 Nanbor Wang <nanbor@cs.wustl.edu>
Diffstat (limited to 'tests/Malloc_Test.cpp')
-rw-r--r-- | tests/Malloc_Test.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/Malloc_Test.cpp b/tests/Malloc_Test.cpp index 3b1106473f2..22a354df2cc 100644 --- a/tests/Malloc_Test.cpp +++ b/tests/Malloc_Test.cpp @@ -188,14 +188,29 @@ print (const char *process_name, static int parent (Test_Data *data) { + MALLOC *myalloc = myallocator (); + { - ACE_GUARD_RETURN (ACE_Process_Mutex, guard, myallocator ()->mutex (), -1); + ACE_GUARD_RETURN (ACE_Process_Mutex, guard, myalloc->mutex (), -1); print ("parent", data); } // Sleep for a 200 msecs so that the child will have a chance to spin! ACE_OS::sleep (ACE_Time_Value (0, 200 * 1000)); - int result = myallocator ()->bind ("bar", data); + + char *small_buf[1024]; + int cntr; + + for (cntr = 0 ; cntr < 1024; ++cntr) + small_buf[cntr] = (char *) myalloc->malloc (1); + char *big_buf = (char *) myalloc->malloc (1024 * 4069); + + int result = myalloc->bind ("bar", data); + + myalloc->free (big_buf); + for (cntr = 0 ; cntr < 1024; ++cntr) + myalloc->free (small_buf[cntr]); + ACE_ASSERT (result != -1); return 0; } |