[GB.DATA]

* OPT: Great overhaul of List algorithms. Beware: Still buggy.
* OPT: Make list chunks carry multiple Variants to improve cache locality.
* OPT: Don't traverse List forwards/backwards when the absolute value of
  index is past the half of Count.
* NEW: Introduce List.Backwards - a virtual object to enumerate backwards
* NEW: Don't use List.Current as enumeration pointer.
* NEW: Begin enumeration at the first/last node.
* NEW: Traverse backwards when given negative index to _get.
* NEW: Make Current invalid by default.
* NEW: Assign first/last element when MoveNext()/MovePrev() is issued on an
  invalid Current.
* NEW: Use List.Current as pointer for the Find*() methods, too.
* NEW: Assign first/last element when FindNext()/FindPrev() is issued on an
  invalid Current.
* NEW: Don't return an index from Find*() methods because it is not the way
  linked list are dealt with.
* NEW: Make insertion and removal of elements safe in enumerations.
* NEW: When Current (or enumerator) is removed, the pointer remains relative
  to the beginning of the List but it never wraps around the end.
* BUG: Correctly *cycle* with {Move,Find}{Next,Prev}()



git-svn-id: svn://localhost/gambas/trunk@5302 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Tobias Boege 2012-11-06 21:03:07 +00:00
parent 34de79ef3d
commit b417f1861e
5 changed files with 607 additions and 260 deletions

View file

@ -28,7 +28,7 @@
typedef struct { typedef struct {
GB_VARIANT_VALUE var; GB_VARIANT_VALUE var;
LIST list; LIST list;
int prio; /* FIXME: only used in priority queue */ int prio;
} CDEQUE_ELEM; } CDEQUE_ELEM;
#define get_elem(node) LIST_data(node, CDEQUE_ELEM, list) #define get_elem(node) LIST_data(node, CDEQUE_ELEM, list)

File diff suppressed because it is too large Load diff

View file

@ -29,6 +29,7 @@ extern GB_INTERFACE GB;
#ifndef __C_LIST_C #ifndef __C_LIST_C
extern GB_DESC CListDesc[]; extern GB_DESC CListDesc[];
extern GB_DESC CListBackwardsDesc[];
extern void CLIST_exit(void); extern void CLIST_exit(void);
#endif #endif

View file

@ -1,4 +1,3 @@
[Component] [Component]
Author=Tobias Boege Author=Tobias Boege
State=Unfinished State=Unfinished

View file

@ -30,6 +30,7 @@ GB_INTERFACE GB EXPORT;
GB_DESC *GB_CLASSES[] EXPORT = { GB_DESC *GB_CLASSES[] EXPORT = {
CListDesc, CListDesc,
CListBackwardsDesc,
CDequeDesc, CDequeDesc,
CStackDesc, CStackDesc,