Index: libcfa/src/concurrency/actor.hfa
===================================================================
--- libcfa/src/concurrency/actor.hfa	(revision f23d34db26cec6c6f32cf80f98f35530197c7526)
+++ libcfa/src/concurrency/actor.hfa	(revision e23169b8a1ac634d67009a7a7f4e9e9976bacdec)
@@ -371,12 +371,16 @@
 
 // this is a static field of executor but have to forward decl for get_next_ticket
-static unsigned long int __next_ticket = 0; 
-
-static inline unsigned long int __get_next_ticket( executor & this ) with(this) {
-    unsigned long int temp = __atomic_fetch_add( &__next_ticket, 1, __ATOMIC_SEQ_CST) % nrqueues;
+static size_t __next_ticket = 0; 
+
+static inline size_t __get_next_ticket( executor & this ) with(this) {
+    #ifdef __CFA_DEBUG__
+    size_t temp = __atomic_fetch_add( &__next_ticket, 1, __ATOMIC_SEQ_CST) % nrqueues;
 
     // reserve MAX for dead actors
-    if ( temp == MAX ) temp = __atomic_fetch_add( &__next_ticket, 1, __ATOMIC_SEQ_CST) % nrqueues;
+    if ( unlikely( temp == MAX ) ) temp = __atomic_fetch_add( &__next_ticket, 1, __ATOMIC_SEQ_CST) % nrqueues;
     return temp;
+    #else
+    return __atomic_fetch_add( &__next_ticket, 1, __ATOMIC_RELAXED) % nrqueues;
+    #endif
 } // tickets
 
@@ -384,18 +388,18 @@
 static executor * __actor_executor_ = 0p;
 static bool __actor_executor_passed = false;            // was an executor passed to start_actor_system
-static unsigned long int __num_actors_ = 0;				// number of actor objects in system
+static size_t __num_actors_ = 0;				// number of actor objects in system
 static struct thread$ * __actor_executor_thd = 0p;		// used to wake executor after actors finish
 struct actor {
-    unsigned long int ticket;	                        // executor-queue handle
+    size_t ticket;	                        // executor-queue handle
     Allocation allocation_;			                    // allocation action
 };
 
-static inline void ?{}( actor & this ) {
+static inline void ?{}( actor & this ) with(this) {
     // Once an actor is allocated it must be sent a message or the actor system cannot stop. Hence, its receive
     // member must be called to end it
     verifyf( __actor_executor_, "Creating actor before calling start_actor_system() can cause undefined behaviour.\n" ); 
-    this.allocation_ = Nodelete;
-    this.ticket = __get_next_ticket( *__actor_executor_ );
-    __atomic_fetch_add( &__num_actors_, 1, __ATOMIC_SEQ_CST );
+    allocation_ = Nodelete;
+    ticket = __get_next_ticket( *__actor_executor_ );
+    __atomic_fetch_add( &__num_actors_, 1, __ATOMIC_RELAXED );
     #ifdef STATS
     __atomic_fetch_add( &__num_actors_stats, 1, __ATOMIC_SEQ_CST );
@@ -418,5 +422,5 @@
         }
 
-        if ( unlikely( __atomic_add_fetch( &__num_actors_, -1, __ATOMIC_SEQ_CST ) == 0 ) ) { // all actors have terminated
+        if ( unlikely( __atomic_add_fetch( &__num_actors_, -1, __ATOMIC_RELAXED ) == 0 ) ) { // all actors have terminated
             unpark( __actor_executor_thd );
         }
@@ -430,5 +434,5 @@
 static inline void ?{}( message & this ) { this.allocation_ = Nodelete; }
 static inline void ?{}( message & this, Allocation allocation ) {
-    this.allocation_ = allocation;
+    memcpy( &this.allocation_, &allocation, sizeof(allocation) ); // optimization to elide ctor
     verifyf( this.allocation_ != Finished, "The Finished Allocation status is not supported for message types.\n");
 }
@@ -449,6 +453,5 @@
 
 static inline void deliver_request( request & this ) {
-    Allocation actor_allocation = this.fn( *this.receiver, *this.msg );
-    this.receiver->allocation_ = actor_allocation;
+    this.receiver->allocation_ = this.fn( *this.receiver, *this.msg );
     check_actor( *this.receiver );
     check_message( *this.msg );
@@ -563,11 +566,9 @@
     unsigned int empty_count = 0;
     request & req;
-    unsigned int curr_idx;
     work_queue * curr_work_queue;
 
     Exit:
     for ( unsigned int i = 0;; i = (i + 1) % range ) { // cycle through set of request buffers
-        curr_idx = i + start;
-        curr_work_queue = request_queues[curr_idx];
+        curr_work_queue = request_queues[i + start];
         
         // check if queue is empty before trying to gulp it
