lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev dev.10 progress


From: Leonid Pauzner
Subject: Re: lynx-dev dev.10 progress
Date: Tue, 19 Nov 2002 11:52:08 +0300 (MSK)

18-Nov-2002 06:20 Thomas E. Dickey wrote:
> intended fixing for dev.10.  The catch-up portion is in
> ftp://invisible-island.net/temp (that doesn't include the changes I'm


Patch against your version:
(POOL_SIZE include malloc header overhead and proper brackets in expression:)


diff -u -p old/gridtext.c ./gridtext.c
--- old/gridtext.c      Tue Nov 19 11:36:58 2002
+++ ./gridtext.c        Tue Nov 19 11:37:18 2002
@@ -167,11 +167,11 @@ typedef struct {
 static HTStyleChange stylechanges_buffers[2][MAX_STYLES_ON_LINE];
 #endif

-#define POOL_SIZE (8192 - (sizeof(struct _HTPool*) - sizeof(int)) / 
sizeof(HTStyleChange))
+#define POOL_SIZE (8192 - 4*sizeof(void*) - sizeof(struct _HTPool*) + 
sizeof(int)) / sizeof(HTStyleChange)

 typedef struct _HTPool {
     HTStyleChange   data[POOL_SIZE];
-    struct _HTPool* next;
+    struct _HTPool* prev;
     int used;
 } HTPool;

@@ -181,12 +181,12 @@ same members as HTPool).  Pools are used
 objects of the same type T.  Pools are represented as a list of structures of
 type P (called pool chunks here).  Structure P has an array of N objects of
 type T named 'data' (the number N in the array can be chosen arbitrary),
-pointer to the next pool chunk named 'next', and the number of used items in
-that pool chunk named 'used'.  Here is a definition of the structure P:
+pointer to the previous pool chunk named 'prev', and the number of used items
+in that pool chunk named 'used'.  Here is a definition of the structure P:
        struct P
        {
            T data[N];
-           struct P* next;
+           struct P* prev;
            int used;
        };
  It's recommended that sizeof(P) be memory page size minus 32 in order malloc'd
@@ -248,7 +248,7 @@ void POOL_FREE( pool_type , P*& ptr)
            if (!newpool) {                             \
                ptr = NULL;                             \
            } else {                                    \
-               newpool->next = pool;                   \
+               newpool->prev = pool;                   \
                newpool->used = toalloc;                \
                ptr = newpool->data;                    \
                pool = newpool;                         \
@@ -264,7 +264,7 @@ void POOL_FREE( pool_type , P*& ptr)
     {                                                  \
        ptr = (pool_type*)LY_CALLOC(1, sizeof(pool_type)); \
        if (ptr) {                                      \
-           ptr->next = NULL;                           \
+           ptr->prev = NULL;                           \
            ptr->used = 0;                              \
        }                                               \
     }
@@ -277,7 +277,7 @@ void POOL_FREE( pool_type , P*& ptr)
        pool_type* cur = ptr;                           \
        pool_type* prev;                                \
        while (cur) {                                   \
-           prev = cur->next;                           \
+           prev = cur->prev;                           \
            FREE(cur);                                  \
            cur = prev;                                 \
        }                                               \



; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]