summaryrefslogtreecommitdiff
path: root/ace/Malloc.h
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1999-07-07 05:42:03 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1999-07-07 05:42:03 +0000
commit663d502086dcfa5aab4e99db2f872592b53ed739 (patch)
treef3961ecb0a771c015bbca524252cf96b3725d9eb /ace/Malloc.h
parente5431d0822351c2a394149fc781f50ddf94cf571 (diff)
downloadATCD-663d502086dcfa5aab4e99db2f872592b53ed739.tar.gz
ChangeLogTag:Wed Jul 7 00:37:22 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
Diffstat (limited to 'ace/Malloc.h')
-rw-r--r--ace/Malloc.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/ace/Malloc.h b/ace/Malloc.h
index 57e240da004..96a64054949 100644
--- a/ace/Malloc.h
+++ b/ace/Malloc.h
@@ -34,6 +34,10 @@
#define ACE_PROCESS_MUTEX ACE_SV_Semaphore_Simple
#endif /* ACE_HAS_THREADS */
+#if defined (ACE_HAS_BASED_POINTER_MALLOC)
+#include "ace/Based_Pointer_T.h"
+#endif /* ACE_HAS_BASED_POINTER_MALLOC */
+
typedef ACE_Atomic_Op<ACE_PROCESS_MUTEX, int> ACE_INT;
struct ACE_Export ACE_Malloc_Stats
@@ -57,6 +61,7 @@ struct ACE_Export ACE_Malloc_Stats
#define AMS(X)
#endif /* ACE_HAS_MALLOC_STATS */
+#if !defined (ACE_MALLOC_ALIGN)
// ACE_MALLOC_ALIGN allows you to insure that allocated regions are at
// least <ACE_MALLOC_ALIGN> bytes long. It is especially useful when
// you want areas to be at least a page long, or 32K long, or
@@ -71,17 +76,27 @@ struct ACE_Export ACE_Malloc_Stats
// use a signed integer number of bytes you want. For example:
// #define ACE_MALLOC_ALIGN ((int)4096)
-#if !defined (ACE_MALLOC_ALIGN)
#define ACE_MALLOC_ALIGN ((int)(sizeof (long)))
#endif /* ACE_MALLOC_ALIGN */
union ACE_Export ACE_Malloc_Header
{
- // TITLE
- // This is a block header.
+ // = TITLE
+ // We use a union to force alignment to the most restrictive type.
- struct ACE_Malloc_Control_Block
+ class ACE_Malloc_Control_Block
{
+ // = TITLE
+ // This is the control block header. It's used by <ACE_Malloc>
+ // to keep track of each chunk of data when it's in the free
+ // list or in use.
+ public:
+#if defined (ACE_HAS_BASED_POINTER_MALLOC)
+ ACE_Based_Pointer<ACE_Malloc_Header> *next_block_;
+#else
+ ACE_Malloc_Header *next_block_;
+#endif /* ACE_HAS_BASED_POINTER_MALLOC */
+
ACE_Malloc_Header *next_block_;
// Points to next block if on free list.