WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Cset exclude: cl349@xxxxxxxxxxxxxxxxxxxx|ChangeSet|20050

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Cset exclude: cl349@xxxxxxxxxxxxxxxxxxxx|ChangeSet|20050513143651|29037
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Fri, 13 May 2005 18:28:45 +0000
Delivery-date: Fri, 13 May 2005 20:07:15 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1389.1.61, 2005/05/13 19:28:45+01:00, smh22@xxxxxxxxxxxxxxxxxxxx

        Cset exclude: cl349@xxxxxxxxxxxxxxxxxxxx|ChangeSet|20050513143651|29037



 sxpr_parser.c |   25 +++----------------------
 sxpr_parser.h |    4 ++--
 2 files changed, 5 insertions(+), 24 deletions(-)


diff -Nru a/tools/libxutil/sxpr_parser.c b/tools/libxutil/sxpr_parser.c
--- a/tools/libxutil/sxpr_parser.c      2005-05-13 16:07:50 -04:00
+++ b/tools/libxutil/sxpr_parser.c      2005-05-13 16:07:50 -04:00
@@ -160,8 +160,6 @@
     if(!z) return;
     objfree(z->val);
     z->val = ONONE;
-    if (z->buf)
-        deallocate(z->buf);
     deallocate(z);
 }
 
@@ -173,7 +171,6 @@
   
     if(!z) goto exit;
     err = 0;
-    z->buf = NULL;
     reset(z);
   exit:
     if(err){
@@ -204,16 +201,8 @@
 static int savechar(Parser *p, char c){
     int err = 0;
     if(p->buf_i >= p->buf_n){
-        char *nbuf;
-        nbuf = allocate(2 * (p->buf_n + 1));
-        if (nbuf == NULL) {
-            err = -ENOMEM;
-            goto exit;
-        }
-        memcpy(nbuf, p->buf, p->buf_i);
-        deallocate(p->buf);
-       p->buf = nbuf;
-       p->buf_n = 2 * (p->buf_n + 1) - 1;
+        err = -ENOMEM;
+        goto exit;
     }
     p->buf[p->buf_i] = c;
     p->buf_i++;
@@ -698,16 +687,8 @@
 static void reset(Parser *z){
   IOStream *error_out = z->error_out;
   int flags = z->flags;
-  int buf_n = z->buf_n;
-  char *buf = z->buf;
   memzero(z, sizeof(Parser));
-  if (buf) {
-      z->buf = buf;
-      z->buf_n = buf_n;
-  } else {
-      z->buf = (char *)allocate(PARSER_BUF_SIZE);
-      z->buf_n = PARSER_BUF_SIZE - 1;
-  }
+  z->buf_n = sizeof(z->buf) - 1;
   z->buf_i = 0;
   z->line_no = 1;
   z->char_no = 0;
diff -Nru a/tools/libxutil/sxpr_parser.h b/tools/libxutil/sxpr_parser.h
--- a/tools/libxutil/sxpr_parser.h      2005-05-13 16:07:50 -04:00
+++ b/tools/libxutil/sxpr_parser.h      2005-05-13 16:07:50 -04:00
@@ -28,7 +28,7 @@
 /** Size of a parser input buffer.
  * Tokens read must fit into this size (including trailing null).
  */
-#define PARSER_BUF_SIZE 1024
+#define PARSER_BUF_SIZE 4096
 
 struct Parser;
 typedef int ParserStateFn(struct Parser *, char c);
@@ -60,7 +60,7 @@
     /** Lookahead character. */
     char c;
     /** Buffer for reading tokens. */
-    char *buf;
+    char buf[PARSER_BUF_SIZE];
     /** Size of token buffer. */
     int buf_n;
     int buf_i;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Cset exclude: cl349@xxxxxxxxxxxxxxxxxxxx|ChangeSet|20050513143651|29037, BitKeeper Bot <=