fix partitioning in garbage collector
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@254 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
7064c42fc1
commit
3d496ae6be
14
C/heapgc.c
14
C/heapgc.c
@ -157,7 +157,7 @@ POPSWAP_POINTER(CELL_PTR *vp) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
exchange(CELL_PTR * b, UInt i, UInt j)
|
exchange(CELL_PTR * b, Int i, Int j)
|
||||||
{
|
{
|
||||||
CELL *t = b[j];
|
CELL *t = b[j];
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ exchange(CELL_PTR * b, UInt i, UInt j)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static UInt
|
static UInt
|
||||||
partition(CELL *a[], UInt p, UInt r)
|
partition(CELL *a[], Int p, Int r)
|
||||||
{
|
{
|
||||||
CELL *x;
|
CELL *x;
|
||||||
UInt i, j;
|
UInt i, j;
|
||||||
@ -175,7 +175,7 @@ partition(CELL *a[], UInt p, UInt r)
|
|||||||
i = p+1;
|
i = p+1;
|
||||||
j = r;
|
j = r;
|
||||||
|
|
||||||
while (a[j] > x) {
|
while (a[j] > x && i < j) {
|
||||||
j--;
|
j--;
|
||||||
}
|
}
|
||||||
while (a[i] < x && i < j) {
|
while (a[i] < x && i < j) {
|
||||||
@ -185,7 +185,7 @@ partition(CELL *a[], UInt p, UInt r)
|
|||||||
exchange(a, i, j);
|
exchange(a, i, j);
|
||||||
i++;
|
i++;
|
||||||
j--;
|
j--;
|
||||||
while (a[j] > x) {
|
while (a[j] > x && i < j) {
|
||||||
j--;
|
j--;
|
||||||
}
|
}
|
||||||
while (a[i] < x && i < j) {
|
while (a[i] < x && i < j) {
|
||||||
@ -199,7 +199,7 @@ partition(CELL *a[], UInt p, UInt r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
insort(CELL *a[], UInt p, UInt q)
|
insort(CELL *a[], Int p, Int q)
|
||||||
{
|
{
|
||||||
UInt j;
|
UInt j;
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ insort(CELL *a[], UInt p, UInt q)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
quicksort(CELL *a[], UInt p, UInt r)
|
quicksort(CELL *a[], Int p, Int r)
|
||||||
{
|
{
|
||||||
UInt q;
|
UInt q;
|
||||||
if (p < r) {
|
if (p < r) {
|
||||||
@ -572,7 +572,7 @@ init_dbtable(tr_fr_ptr trail_ptr) {
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
||||||
#define INSTRUMENT_GC 1
|
#define INSTRUMENT_GC 1
|
||||||
#define CHECK_CHOICEPOINTS 1
|
/* #define CHECK_CHOICEPOINTS 1 */
|
||||||
|
|
||||||
#ifdef INSTRUMENT_GC
|
#ifdef INSTRUMENT_GC
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
Reference in New Issue
Block a user