if (uninit_id >= (int)vec->size()) {
int oldsize = (int) vec->size();
vec->resize(uninit_id + 1);
- for(int i=oldsize;i<uninit_id+1;i++)
- new (&vec[i]) action_list_t();
+ for(int i=oldsize;i<uninit_id+1;i++) {
+ new(&(*vec)[i]) action_list_t();
+ }
}
(*vec)[uninit_id].push_front(uninit);
}
uint oldsize =vec->size();
vec->resize(priv->next_thread_id);
for(uint i=oldsize;i<priv->next_thread_id;i++)
- new (&vec[i]) action_list_t();
+ new (&(*vec)[i]) action_list_t();
}
(*vec)[tid].push_back(act);
if (uninit)
uint oldsize = vec->size();
vec->resize(priv->next_thread_id);
for(uint i=oldsize;i<priv->next_thread_id;i++)
- new (&vec[i]) action_list_t();
+ new (&(*vec)[i]) action_list_t();
}
(*vec)[tid].push_back(act);
}
uint oldsize =vec->size();
vec->resize(priv->next_thread_id);
for(uint i=oldsize;i<priv->next_thread_id;i++)
- new (&vec[i]) action_list_t();
+ new (&(*vec)[i]) action_list_t();
}
insertIntoActionList(&(*vec)[tid],act);
uint oldsize =vec->size();
vec->resize(priv->next_thread_id);
for(uint i=oldsize;i<priv->next_thread_id;i++)
- new (&vec[i]) action_list_t();
+ new (&(*vec)[i]) action_list_t();
}
(*vec)[tid].push_back(write);
}
thrd_func_inst_lists = model->get_execution()->get_thrd_func_inst_lists();
if ( thrd_func_list->size() <= id ) {
- thrd_func_list->resize( id + 1 );
+ uint oldsize = thrd_func_list->size();
+ thrd_func_list->resize( id + 1 );
+ for(uint i=oldsize; i<id+1; i++) {
+ new(&(*thrd_func_list)[i]) func_id_list_t();
+ }
thrd_func_inst_lists->resize( id + 1 );
}
void pop_front() {
mllnode<_Tp> *tmp = head;
head = head->next;
- head->prev = NULL;
+ if (head == NULL)
+ tail = NULL;
+ else
+ head->prev = NULL;
delete tmp;
_size--;
}
void pop_back() {
mllnode<_Tp> *tmp = tail;
- tail = tail->next;
- tail->next = NULL;
+ tail = tail->prev;
+ if (tail == NULL)
+ head = NULL;
+ else
+ tail->next = NULL;
delete tmp;
_size--;
}
void pop_front() {
sllnode<_Tp> *tmp = head;
head = head->next;
- head->prev = NULL;
+ if (head == NULL)
+ tail = NULL;
+ else
+ head->prev = NULL;
delete tmp;
_size--;
}
void pop_back() {
sllnode<_Tp> *tmp = tail;
- tail = tail->next;
- tail->next = NULL;
+ tail = tail->prev;
+ if (tail == NULL)
+ head = NULL;
+ else
+ tail->next = NULL;
delete tmp;
_size--;
}
array[_size++] = item;
}
- type operator[](uint index) const {
+ type operator[](int index) const {
return array[index];
}
- type & operator[](uint index) {
+ type & operator[](int index) {
return array[index];
}
array[_size++] = item;
}
- type & operator[](uint index) {
+ type operator[](int index) const {
return array[index];
}
- type operator[](uint index) const {
+ type & operator[](int index) {
return array[index];
}