summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormike <mike>2008-10-23 18:58:28 +0000
committermike <mike>2008-10-23 18:58:28 +0000
commit62848ebea353f442cd3af443d33c469b45f5ae39 (patch)
treedbc91f817a847434950d3e2472743d39fd2031f3
parentc8ec2ed81aa45cc9d287ca0d78582c2a6db4b954 (diff)
downloadtog-pegasus-TASK-PEP305_VXWORKS-branch.zip
tog-pegasus-TASK-PEP305_VXWORKS-branch.tar.gz
tog-pegasus-TASK-PEP305_VXWORKS-branch.tar.xz
TITLE: VxWorks Port DESCRIPTION: Ongoing VxWorks porting
-rw-r--r--src/Pegasus/Common/Alloc.cpp30
-rw-r--r--src/Pegasus/Common/Alloc.h48
-rw-r--r--src/Pegasus/Common/MessageQueueService.cpp1
-rw-r--r--src/Pegasus/Common/Thread.cpp4
4 files changed, 40 insertions, 43 deletions
diff --git a/src/Pegasus/Common/Alloc.cpp b/src/Pegasus/Common/Alloc.cpp
index 4a93665..53d2e02 100644
--- a/src/Pegasus/Common/Alloc.cpp
+++ b/src/Pegasus/Common/Alloc.cpp
@@ -264,3 +264,33 @@ extern "C" void pegasus_free(void* ptr)
assert(block->magic == BLOCK_MAGIC);
free(block);
}
+
+void* operator new(size_t size) throw(std::bad_alloc)
+{
+ return pegasus_malloc(size);
+}
+
+void* operator new[](size_t size) throw(std::bad_alloc)
+{
+ return pegasus_malloc(size);
+}
+
+void operator delete(void* ptr)
+{
+ pegasus_free(ptr);
+}
+
+void operator delete[](void* ptr)
+{
+ pegasus_free(ptr);
+}
+
+void operator delete(void* ptr, size_t)
+{
+ pegasus_free(ptr);
+}
+
+void operator delete[](void* ptr, size_t)
+{
+ pegasus_free(ptr);
+}
diff --git a/src/Pegasus/Common/Alloc.h b/src/Pegasus/Common/Alloc.h
index e6aa2d7..b4abf31 100644
--- a/src/Pegasus/Common/Alloc.h
+++ b/src/Pegasus/Common/Alloc.h
@@ -40,53 +40,25 @@
#include <Pegasus/Common/Linkage.h>
#include <stdlib.h>
#include <malloc.h>
-
#if defined(__cplusplus)
# include <new>
+#endif
-extern "C" PEGASUS_COMMON_LINKAGE void* pegasus_malloc(size_t size);
-extern "C" PEGASUS_COMMON_LINKAGE void (*pegasus_malloc_notifier)(size_t total);
-extern "C" PEGASUS_COMMON_LINKAGE void* pegasus_realloc(void* ptr, size_t size);
-extern "C" PEGASUS_COMMON_LINKAGE void pegasus_free(void* ptr);
-
-inline void* operator new(size_t size) throw(std::bad_alloc)
-{
- return pegasus_malloc(size);
-}
-
-inline void* operator new[](size_t size) throw(std::bad_alloc)
-{
- return pegasus_malloc(size);
-}
-
-inline void operator delete(void* ptr)
-{
- pegasus_free(ptr);
-}
-
-inline void operator delete[](void* ptr)
-{
- pegasus_free(ptr);
-}
-
-inline void operator delete(void* ptr, size_t)
-{
- pegasus_free(ptr);
-}
-
-inline void operator delete[](void* ptr, size_t)
+#if defined(__cplusplus)
+extern "C"
{
- pegasus_free(ptr);
-}
-
-#else /* defined(__cplusplus) */
+#endif
PEGASUS_COMMON_LINKAGE void* pegasus_malloc(size_t size);
-PEGASUS_COMMON_LINKAGE void (*pegasus_malloc_notifier)(size_t total);
PEGASUS_COMMON_LINKAGE void* pegasus_realloc(void* ptr, size_t size);
PEGASUS_COMMON_LINKAGE void pegasus_free(void* ptr);
+PEGASUS_COMMON_LINKAGE void pegasus_free(void* ptr);
+
+#if defined(__cplusplus)
+}
+#endif
-#endif /* !defined(__cplusplus) */
+extern PEGASUS_COMMON_LINKAGE void (*pegasus_malloc_notifier)(size_t total);
#ifndef PEGASUS_INSIDE_ALLOC_CPP
# define malloc pegasus_malloc
diff --git a/src/Pegasus/Common/MessageQueueService.cpp b/src/Pegasus/Common/MessageQueueService.cpp
index 2182270..84fbdff 100644
--- a/src/Pegasus/Common/MessageQueueService.cpp
+++ b/src/Pegasus/Common/MessageQueueService.cpp
@@ -648,7 +648,6 @@ Boolean MessageQueueService::accept_async(AsyncOpNode* op)
return false;
if (_polling_thread == NULL)
{
-printf("===== NEW3\n");
_polling_thread = new Thread(
polling_routine,
reinterpret_cast<void *>(_get_polling_list()),
diff --git a/src/Pegasus/Common/Thread.cpp b/src/Pegasus/Common/Thread.cpp
index c3b0bec..b289c1e 100644
--- a/src/Pegasus/Common/Thread.cpp
+++ b/src/Pegasus/Common/Thread.cpp
@@ -264,11 +264,7 @@ ATTN: remove this!
num_threads = _num_threads;
printf("Thread::~Thread(): num_threads=%u\n", num_threads);
_num_threads_mutex.unlock();
-<<<<<<< Thread.cpp
#endif
-=======
- //printf("Thread::~Thread(): num_threads=%u\n", num_threads);
->>>>>>> 1.100.2.4
try
{