macsim/src/noc/pbuffer.c
// return the head of the buffer
return the head of the buffer
return the head of the buffer
flit_container_t *msgdeque(p_buffer_t *buffer){
	if(buffer->size == buffer->slots)
		return NULL;
	p_buffer_entry_t *del = buffer->head;
	flit_container_t *f = buffer->head->flit;
	buffer->head = buffer->head->next;
	free(del);
	if(buffer->head == NULL){
		buffer->tail = NULL;
	}
	buffer->slots = buffer->slots + 1;	
	return f;
}
flit_container_t * msgdeque ( p_buffer_t * buffer ) { if ( buffer -> size == buffer -> slots ) return NULL ; p_buffer_entry_t * del = buffer -> head ; flit_container_t * f = buffer -> head -> flit ; buffer -> head = buffer -> head -> next ; free ( del ) ; if ( buffer -> head == NULL ) { buffer -> tail = NULL ; } buffer -> slots = buffer -> slots + 1 ; return f ; }
return the head of the buffer
return the head of the buffer
//increment available slots