[Top][All Lists]

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

Re: Preview: portable dumper

From: Andy Moreton
Subject: Re: Preview: portable dumper
Date: Fri, 16 Feb 2018 11:33:35 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (windows-nt)

On Thu 15 Feb 2018, Eli Zaretskii wrote:

>> Cc: address@hidden, address@hidden
>> From: Daniel Colascione <address@hidden>
>> Date: Wed, 14 Feb 2018 11:26:37 -0800
>> >> It's weird that we're failing there. If we're looking at a buffer with
>> >> dumped contents, we set b->text->beg to NULL, then use the normal
>> >> buffer-allocation procedure (whichever we're compiled to use) to
>> >> allocate memory for the contents. How can the resulting address ever be
>> >> equal to what we started with? Neither mmap_realloc nor r_re_alloc nor
>> >> xrealloc should ever reuse the address.
>> > 
>> > You are talking about what enlarge_buffer_text does?  IOW, this:
>> It should be fixed now. Give it a shot.
> Thanks, the problem is indeed fixed, and with that I was able to
> successfully complete the bootstrap.
> I also tested an optimized build, and a parallel "make -j8" build, and
> they all worked as expected.
> The times to load the .pdmp file are around 20 msec for an unoptimized
> build and 7 msec for an optimized build, which I think is very
> impressive.
> For the record, this is a 32-bit MinGW build configured with
> "--with-large-int --with-modules --enable-checking", on a 3-year old
> Core i7 box running Windows 7.

It fails to build for 64bit Windows with Mingw64 on msys2:

C:/emacs/git/emacs/pdumper/src/pdumper.c: In function 'dump_read_all':
C:/emacs/git/emacs/pdumper/src/pdumper.c:4784:45: error: conversion to 
'unsigned int' from 'size_t {aka long long unsigned int}' may alter its value 
         read (fd, (char*) buf + bytes_read, bytes_to_read - bytes_read);
In file included from C:/emacs/git/emacs/pdumper/src/character.h:27:0,
                 from C:/emacs/git/emacs/pdumper/src/buffer.h:27,
                 from C:/emacs/git/emacs/pdumper/src/pdumper.c:18:
C:/emacs/git/emacs/pdumper/src/pdumper.c: In function 'dump_object_1':
C:/emacs/git/emacs/pdumper/src/lisp.h:206:5: warning: this statement may fall 
through [-Wimplicit-fallthrough=]
    (suppress_checking || (cond)     \
     ? (void) 0       \
     : die (# cond, __FILE__, __LINE__))
C:/emacs/git/emacs/pdumper/src/pdumper.c:2915:11: note: in expansion of macro 
           eassert ("should not be dumping int: is self-representing" && 0);
C:/emacs/git/emacs/pdumper/src/pdumper.c:2916:9: note: here
cc1.exe: some warnings being treated as errors

This appears to be because sys_read() and _read() take an unsigned int
for count rather than size_t. Changing the code to:

read (fd, (char*) buf + bytes_read, (int)(bytes_to_read - bytes_read));

That builds and appears to run, but it would be nicer to get sys_read
etc. to use the proper types.


reply via email to

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