1
1

Replacing C++-style comments with C-style comments.

This commit was SVN r97.
Этот коммит содержится в:
David Daniel 2004-01-07 21:01:40 +00:00
родитель 9515a7f2f0
Коммит fb846e6c0b
10 изменённых файлов: 39 добавлений и 41 удалений

Просмотреть файл

@ -221,10 +221,10 @@ int lam_frl_init_with(
} }
// initialize locks for memory pool and individual list and link locks /* initialize locks for memory pool and individual list and link locks */
for ( pool = 0; pool < flist->fl_nlists; pool++ ) { for ( pool = 0; pool < flist->fl_nlists; pool++ ) {
// gain exclusive use of list /* gain exclusive use of list */
if ( 1 == lam_sgl_lock_list(flist->fl_free_lists[pool]) ) { if ( 1 == lam_sgl_lock_list(flist->fl_free_lists[pool]) ) {
while ( lam_sgl_get_bytes_pushed(flist->fl_free_lists[pool]) while ( lam_sgl_get_bytes_pushed(flist->fl_free_lists[pool])
@ -343,15 +343,15 @@ static void *lam_frl_get_mem_chunk(lam_free_list_t *flist, int index, size_t *le
return chunk; return chunk;
} }
} }
// set len /* set len */
*len = sz_to_add; *len = sz_to_add;
// get chunk of memory /* get chunk of memory */
chunk = lam_mp_request_chunk(flist->fl_pool, index); chunk = lam_mp_request_chunk(flist->fl_pool, index);
if ( 0 == chunk ) if ( 0 == chunk )
{ {
// increment failure count /* increment failure count */
lam_sgl_inc_consec_fail(flist->fl_free_lists[index]); lam_sgl_inc_consec_fail(flist->fl_free_lists[index]);
if ( lam_sgl_get_consec_fail(flist->fl_free_lists[index]) >= if ( lam_sgl_get_consec_fail(flist->fl_free_lists[index]) >=
lam_sgl_get_max_consec_fail(flist->fl_free_lists[index]) ) lam_sgl_get_max_consec_fail(flist->fl_free_lists[index]) )
@ -394,7 +394,7 @@ static lam_flist_elt_t *lam_flr_request_elt(lam_free_list_t *flist, int pool_idx
static void lam_frl_append(lam_free_list_t *flist, void *chunk, int pool_idx) static void lam_frl_append(lam_free_list_t *flist, void *chunk, int pool_idx)
{ {
/* ASSERT: mp_chunk_sz >= fl_elt_per_chunk * fl_elt_size */ /* ASSERT: mp_chunk_sz >= fl_elt_per_chunk * fl_elt_size */
// push items onto list /* push items onto list */
lam_sgl_append_elt_chunk(flist->fl_free_lists[pool_idx], lam_sgl_append_elt_chunk(flist->fl_free_lists[pool_idx],
chunk, lam_mp_get_chunk_size(flist->fl_pool), chunk, lam_mp_get_chunk_size(flist->fl_pool),
flist->fl_elt_per_chunk, flist->fl_elt_size); flist->fl_elt_per_chunk, flist->fl_elt_size);
@ -417,7 +417,7 @@ static int lam_frl_create_more_elts(lam_free_list_t *flist, int pool_idx)
return err; return err;
} }
// attach memory affinity /* attach memory affinity */
if ( flist->fl_enforce_affinity ) if ( flist->fl_enforce_affinity )
{ {
if (!lam_set_affinity(ptr, len_added, if (!lam_set_affinity(ptr, len_added,

Просмотреть файл

@ -158,7 +158,7 @@ int lam_mp_init_with(lam_mem_pool_t *pool, uint64_t pool_size,
pool->mp_chunks[chunk].chd_base_ptr = ptr; pool->mp_chunks[chunk].chd_base_ptr = ptr;
ptr += chunk_size; ptr += chunk_size;
} }
// set next available chunk /* set next available chunk */
pool->mp_next_avail_chunk = 0; pool->mp_next_avail_chunk = 0;
return 1; return 1;
@ -174,10 +174,10 @@ void *lam_mp_request_chunk(lam_mem_pool_t *pool, int pool_index)
size_t to_alloc; size_t to_alloc;
int desc; int desc;
// grab lock on pool /* grab lock on pool */
lam_mtx_lock(&(pool->mp_lock)); lam_mtx_lock(&(pool->mp_lock));
// Have we used all the allocated memory ? /* Have we used all the allocated memory? */
if ( pool->mp_next_avail_chunk == pool->mp_num_chunks ) if ( pool->mp_next_avail_chunk == pool->mp_num_chunks )
{ {
@ -223,7 +223,7 @@ void *lam_mp_request_chunk(lam_mem_pool_t *pool, int pool_index)
return chunk; return chunk;
} }
// reset pool chunk counter /* reset pool chunk counter */
pool->mp_num_chunks++; pool->mp_num_chunks++;
} }
@ -370,7 +370,7 @@ int lam_fmp_init_with(lam_fixed_mpool_t *pool, ssize_t initial_allocation,
pool->fmp_segments[pool_idx][0].ms_length = initial_allocation; pool->fmp_segments[pool_idx][0].ms_length = initial_allocation;
pool->fmp_segments[pool_idx][0].ms_mem_available = initial_allocation; pool->fmp_segments[pool_idx][0].ms_mem_available = initial_allocation;
// update the number of elements in use /* update the number of elements in use */
pool->fmp_n_segments[pool_idx] = 1; pool->fmp_n_segments[pool_idx] = 1;
} /* end pool loop */ } /* end pool loop */

Просмотреть файл

@ -46,9 +46,9 @@ void *lam_zero_alloc(size_t len, int mem_prot, int mem_flags)
#else /* this is __osf__ */ #else /* this is __osf__ */
if( mem_flags & MAP_PRIVATE ) { if( mem_flags & MAP_PRIVATE ) {
// /*
// private memory allocation * private memory allocation
// */
fd = open("/dev/zero", O_RDWR); fd = open("/dev/zero", O_RDWR);
if (fd < 0) if (fd < 0)
{ {
@ -79,9 +79,9 @@ void *lam_zero_alloc(size_t len, int mem_prot, int mem_flags)
memset(ptr, 0, paddedLen * sizeof(char)); memset(ptr, 0, paddedLen * sizeof(char));
ptr = (char *)ptr + (pageSize - 1); ptr = (char *)ptr + (pageSize - 1);
ptr = (void *)((long)ptr & ~(pageSize - 1)); ptr = (void *)((long)ptr & ~(pageSize - 1));
// /*
// shared memory allocation * shared memory allocation
// */
fd = -1; fd = -1;
ptr = mmap(ptr, len, mem_prot, MAP_FIXED | mem_flags, fd, 0); ptr = mmap(ptr, len, mem_prot, MAP_FIXED | mem_flags, fd, 0);
@ -91,7 +91,7 @@ void *lam_zero_alloc(size_t len, int mem_prot, int mem_flags)
perror(" mmap failed"); perror(" mmap failed");
return (void *)0; return (void *)0;
} }
} // end memory allocation } /* end memory allocation */
#endif /* __osf__ */ #endif /* __osf__ */
return ptr; return ptr;

Просмотреть файл

@ -132,8 +132,6 @@ static inline int fetchNset(volatile int *addr, int setValue)
return (inputValue); return (inputValue);
} }
//#endif /* __INTEL_COMPILER */
/* /*
* Clear the lock * Clear the lock

Просмотреть файл

@ -20,7 +20,7 @@
#define SMPFirstFragPayload 3496 #define SMPFirstFragPayload 3496
#define SMPSecondFragPayload 8192 #define SMPSecondFragPayload 8192
#define CACHE_ALIGNMENT 256 #define CACHE_ALIGNMENT 256
// Reference: http://developer.apple.com/hardware/ve/caches.html gives cacheline as 32 bytes /* Reference: http://developer.apple.com/hardware/ve/caches.html gives cacheline as 32 bytes */
#else #else
#error #error

Просмотреть файл

@ -132,8 +132,6 @@ static inline int fetchNset(volatile int *addr, int setValue)
return (inputValue); return (inputValue);
} }
//#endif /* __INTEL_COMPILER */
/* /*
* Clear the lock * Clear the lock

Просмотреть файл

@ -132,9 +132,6 @@ inline int fetchNset(volatile int *addr, int setValue)
return (inputValue); return (inputValue);
} }
//#endif /* __INTEL_COMPILER */
/* /*
* Clear the lock * Clear the lock
*/ */

Просмотреть файл

@ -2,9 +2,11 @@
* $HEADER$ * $HEADER$
*/ */
// ulm_os.h - This file contains IRIX OS dependent definitions. /*
* ulm_os.h - This file contains IRIX OS dependent definitions.
*/
// memory page size /* memory page size */
#define LOG2PAGESIZE 13 #define LOG2PAGESIZE 13
#define SMPPAGESIZE (1 << LOG2PAGESIZE) #define SMPPAGESIZE (1 << LOG2PAGESIZE)
@ -15,7 +17,7 @@
#define CACHE_ALIGNMENT 64 #define CACHE_ALIGNMENT 64
// if cxx is invoked with -model ansi -accept restrict_keyword /* if cxx is invoked with -model ansi -accept restrict_keyword */
#ifdef __MODEL_ANSI #ifdef __MODEL_ANSI
#define RESTRICT_MACRO __restrict #define RESTRICT_MACRO __restrict
#else #else

Просмотреть файл

@ -176,10 +176,12 @@ bool lam_reactor_remove(lam_reactor_t* r, int sd, lam_reactor_listener_t* rl, in
void lam_reactor_dispatch(lam_reactor_t* r, int cnt, lam_fd_set_t* rset, lam_fd_set_t* sset, lam_fd_set_t* eset) void lam_reactor_dispatch(lam_reactor_t* r, int cnt, lam_fd_set_t* rset, lam_fd_set_t* sset, lam_fd_set_t* eset)
{ {
// walk through the active list w/out holding lock, as this thread /*
// is the only one that modifies the active list. however, note * walk through the active list w/out holding lock, as this thread
// that the descriptor flags could have been cleared in a callback, * is the only one that modifies the active list. however, note
// so check that the flag is still set before invoking the callbacks * that the descriptor flags could have been cleared in a callback,
* so check that the flag is still set before invoking the callbacks
*/
lam_reactor_descriptor_t *descriptor; lam_reactor_descriptor_t *descriptor;
for(descriptor = (lam_reactor_descriptor_t*)lam_dbl_get_first(&r->r_active); for(descriptor = (lam_reactor_descriptor_t*)lam_dbl_get_first(&r->r_active);
@ -208,7 +210,7 @@ void lam_reactor_dispatch(lam_reactor_t* r, int cnt, lam_fd_set_t* rset, lam_fd_
return; return;
} }
// cleanup any pending deletes while holding the lock /* cleanup any pending deletes while holding the lock */
descriptor = (lam_reactor_descriptor_t*)lam_dbl_get_first(&r->r_active); descriptor = (lam_reactor_descriptor_t*)lam_dbl_get_first(&r->r_active);
while(descriptor != 0) { while(descriptor != 0) {
lam_reactor_descriptor_t* next = (lam_reactor_descriptor_t*)lam_dbl_get_next(&r->r_active); lam_reactor_descriptor_t* next = (lam_reactor_descriptor_t*)lam_dbl_get_next(&r->r_active);
@ -225,7 +227,7 @@ void lam_reactor_dispatch(lam_reactor_t* r, int cnt, lam_fd_set_t* rset, lam_fd_
descriptor = next; descriptor = next;
} }
// add any other pending inserts/deletes /* add any other pending inserts/deletes */
while(lam_dbl_get_size(&r->r_pending)) { while(lam_dbl_get_size(&r->r_pending)) {
lam_reactor_descriptor_t* descriptor = (lam_reactor_descriptor_t*)lam_dbl_remove_first(&r->r_pending); lam_reactor_descriptor_t* descriptor = (lam_reactor_descriptor_t*)lam_dbl_remove_first(&r->r_pending);
if(descriptor->rd_flags == 0) { if(descriptor->rd_flags == 0) {

Просмотреть файл

@ -18,11 +18,12 @@ extern const int LAM_NOTIFY_EXCEPT;
extern lam_class_info_t lam_reactor_cls; extern lam_class_info_t lam_reactor_cls;
// /*
// Utilizes select() to provide callbacks when an event (e.g. readable,writeable,exception) * Utilizes select() to provide callbacks when an event
// occurs on a designated descriptor. Objects interested in receiving callbacks must implement * (e.g. readable,writeable,exception) occurs on a designated
// the lam_reactor_listener_t interface. * descriptor. Objects interested in receiving callbacks must
// * implement the lam_reactor_listener_t interface.
*/
typedef struct _lam_reactor_listener { typedef struct _lam_reactor_listener {
void *rl_user_data; void *rl_user_data;