Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Real Users hate Real Programmers.


devel / comp.unix.programmer / Re: XDestroyImage()

SubjectAuthor
* XDestroyImage()Muttley
+* XDestroyImage()Kalevi Kolttonen
|`- XDestroyImage()Muttley
+* XDestroyImage()James Kuyper
|`* XDestroyImage()Muttley
| +- XDestroyImage()Winston
| `* XDestroyImage()Keith Thompson
|  `- XDestroyImage()Ben Bacarisse
`* XDestroyImage()Scott Lurndal
 +- XDestroyImage()candycanearter07
 `* XDestroyImage()Muttley
  +* XDestroyImage()Scott Lurndal
  |`- XDestroyImage()Muttley
  `* XDestroyImage()Nicolas George
   `* XDestroyImage()candycanearter07
    `* XDestroyImage()Muttley
     `- XDestroyImage()candycanearter07

1
XDestroyImage()

<uiqsp7$54ll$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10858&group=comp.unix.programmer#10858

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mutt...@dastardlyhq.com
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: XDestroyImage()
Date: Sun, 12 Nov 2023 15:59:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <uiqsp7$54ll$1@dont-email.me>
Injection-Date: Sun, 12 Nov 2023 15:59:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2c945a4bea155624527c71ddfb60fe85";
logging-data="168629"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+reuU83eA/GUEnSqnbNzOc"
Cancel-Lock: sha1:pOBT6gT61966fldChbL8DL2G00g=
 by: Mutt...@dastardlyhq.com - Sun, 12 Nov 2023 15:59 UTC

Hello

I'm a bit uncertain from the man page and from googling around whether
XDestroyImage() only frees the XImage structure created by XCreateImage()
or whether it also frees the user allocated memory that gets passed into
XCreateImage().

Anyone know?

Thanks for any help

Re: XDestroyImage()

<uiqtvp$5aof$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10859&group=comp.unix.programmer#10859

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: kal...@kolttonen.fi (Kalevi Kolttonen)
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: XDestroyImage()
Date: Sun, 12 Nov 2023 16:20:09 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 39
Sender: <untosten@0.0.0.0>
Message-ID: <uiqtvp$5aof$1@dont-email.me>
References: <uiqsp7$54ll$1@dont-email.me>
Injection-Date: Sun, 12 Nov 2023 16:20:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a0c437bd26135280a27737093736cf1b";
logging-data="174863"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WOpWUBoyOvBmLcGR7GYnzObrZQBW8ve8="
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.5.11-300.fc39.x86_64 (x86_64))
Cancel-Lock: sha1:SXimA2NYbSYhht759NXcd3CEmxo=
 by: Kalevi Kolttonen - Sun, 12 Nov 2023 16:20 UTC

In comp.unix.programmer Muttley@dastardlyhq.com wrote:
> I'm a bit uncertain from the man page and from googling around whether
> XDestroyImage() only frees the XImage structure created by XCreateImage()
> or whether it also frees the user allocated memory that gets passed into
> XCreateImage().

I just did the following on Fedora Linux 39:

dnf download --source libX11-devel
rpm2cpio libX11-1.8.7-1.fc39.src.rpm | cpio -idm
unxz libX11-1.8.7.tar.xz
tar xvf libX11-1.8.7.tar

and some quick grepping. Here are the relevant results:

int
XDestroyImage(
XImage *ximage)
{ return((*((ximage)->f.destroy_image))((ximage)));
}

image->f.destroy_image = _XDestroyImage;

static int _XDestroyImage (XImage *ximage)
{ Xfree(ximage->data);
Xfree(ximage->obdata);
Xfree(ximage);
return 1;
}

So yes, the user allocated data gets freed by
XDestroyImage().

br,
KK

Re: XDestroyImage()

<uiquim$5dhn$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10860&group=comp.unix.programmer#10860

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mutt...@dastardlyhq.com
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: XDestroyImage()
Date: Sun, 12 Nov 2023 16:30:14 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <uiquim$5dhn$1@dont-email.me>
References: <uiqsp7$54ll$1@dont-email.me> <uiqtvp$5aof$1@dont-email.me>
Injection-Date: Sun, 12 Nov 2023 16:30:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2c945a4bea155624527c71ddfb60fe85";
logging-data="177719"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8wG0L3VYL9lhKCbYYnOgE"
Cancel-Lock: sha1:iIOeusSyMmhYWwWsxuDpEi8740M=
 by: Mutt...@dastardlyhq.com - Sun, 12 Nov 2023 16:30 UTC

On Sun, 12 Nov 2023 16:20:09 -0000 (UTC)
kalevi@kolttonen.fi (Kalevi Kolttonen) wrote:
>In comp.unix.programmer Muttley@dastardlyhq.com wrote:
>> I'm a bit uncertain from the man page and from googling around whether
>> XDestroyImage() only frees the XImage structure created by XCreateImage()
>> or whether it also frees the user allocated memory that gets passed into
>> XCreateImage().
>
>I just did the following on Fedora Linux 39:
>
> dnf download --source libX11-devel
> rpm2cpio libX11-1.8.7-1.fc39.src.rpm | cpio -idm
> unxz libX11-1.8.7.tar.xz
> tar xvf libX11-1.8.7.tar
>
>and some quick grepping. Here are the relevant results:
>
>int
>XDestroyImage(
> XImage *ximage)
>{
> return((*((ximage)->f.destroy_image))((ximage)));
>}
>
>
>image->f.destroy_image = _XDestroyImage;
>
>
>static int _XDestroyImage (XImage *ximage)
>{
> Xfree(ximage->data);
> Xfree(ximage->obdata);
> Xfree(ximage);
> return 1;
>}
>
>So yes, the user allocated data gets freed by
>XDestroyImage().

Thanks. Seems a bit inconsistent that XCreateImage() can't allocate but then
thats Xlib for you.

Re: XDestroyImage()

<uir1o9$5nkq$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10861&group=comp.unix.programmer#10861

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: XDestroyImage()
Date: Sun, 12 Nov 2023 12:24:25 -0500
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <uir1o9$5nkq$1@dont-email.me>
References: <uiqsp7$54ll$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 12 Nov 2023 17:24:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ffd1f08d358f7cf8b1a4e9427d4543db";
logging-data="188058"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197vt6upICaX714OS1UnyTttTU0so2rV+w="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:OiIBnemKyslRNqHN8hRbb1Kug9o=
Content-Language: en-US
In-Reply-To: <uiqsp7$54ll$1@dont-email.me>
 by: James Kuyper - Sun, 12 Nov 2023 17:24 UTC

In comp.unix.programmer Muttley@dastardlyhq.com wrote:
> I'm a bit uncertain from the man page and from googling around whether
> XDestroyImage() only frees the XImage structure created by XCreateImage()
> or whether it also frees the user allocated memory that gets passed into
> XCreateImage().

The man page that I found describing the XDestroyImage macro says, quite
prominently:

"Note that when the image is created using XCreateImage(), XGetImage(),
or XSubImage(), the destroy procedure that this macro calls frees both
the image structure and the data pointed to by the image structure."

Does the manpage you viewed lack that statement?

Re: XDestroyImage()

<K084N.102$ayBd.16@fx07.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10862&group=comp.unix.programmer#10862

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!news.neodome.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx07.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: XDestroyImage()
Newsgroups: comp.unix.programmer,comp.windows.x
References: <uiqsp7$54ll$1@dont-email.me>
Lines: 16
Message-ID: <K084N.102$ayBd.16@fx07.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sun, 12 Nov 2023 17:34:34 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sun, 12 Nov 2023 17:34:34 GMT
X-Received-Bytes: 1173
 by: Scott Lurndal - Sun, 12 Nov 2023 17:34 UTC

Muttley@dastardlyhq.com writes:
>Hello
>
>I'm a bit uncertain from the man page and from googling around whether
>XDestroyImage() only frees the XImage structure created by XCreateImage()
>or whether it also frees the user allocated memory that gets passed into
>XCreateImage().
>
>Anyone know?

Kalevi answered.

To obtain an answer this question you could have run the application under
valgrind - it would tell you about any memory that hadn't been
deallocated at exit (using the leak check option).

Re: XDestroyImage()

<uirt4o$7n1l$6@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10863&group=comp.unix.programmer#10863

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no...@thanks.net (candycanearter07)
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: XDestroyImage()
Date: Sun, 12 Nov 2023 19:11:52 -0600
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <uirt4o$7n1l$6@dont-email.me>
References: <uiqsp7$54ll$1@dont-email.me> <K084N.102$ayBd.16@fx07.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 13 Nov 2023 01:11:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d2a08297425b6fea4486311ea4d11011";
logging-data="252981"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ZEgjHc1qw/wzpj5YWrkEI4pNNfSfzX1b7byvuVwVCGQ=="
User-Agent: Betterbird (Linux)
Cancel-Lock: sha1:XXyPlNGj4YG5+vmsxP+XXw1H/bk=
In-Reply-To: <K084N.102$ayBd.16@fx07.iad>
Content-Language: en-US
 by: candycanearter07 - Mon, 13 Nov 2023 01:11 UTC

On 11/12/23 11:34, Scott Lurndal wrote:
> Muttley@dastardlyhq.com writes:
>> Hello
>>
>> I'm a bit uncertain from the man page and from googling around whether
>> XDestroyImage() only frees the XImage structure created by XCreateImage()
>> or whether it also frees the user allocated memory that gets passed into
>> XCreateImage().
>>
>> Anyone know?
>
> Kalevi answered.
>
> To obtain an answer this question you could have run the application under
> valgrind - it would tell you about any memory that hadn't been
> deallocated at exit (using the leak check option).
>

Or, you could set the user memory to a stack variable and see what happens.
--
user <candycane> is generated from /dev/urandom

Re: XDestroyImage()

<uisvuj$kdn3$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10864&group=comp.unix.programmer#10864

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mutt...@dastardlyhq.com
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: XDestroyImage()
Date: Mon, 13 Nov 2023 11:05:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <uisvuj$kdn3$1@dont-email.me>
References: <uiqsp7$54ll$1@dont-email.me> <uir1o9$5nkq$1@dont-email.me>
Injection-Date: Mon, 13 Nov 2023 11:05:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="99481a517071d6aa430244b9f982749e";
logging-data="669411"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18A3Pys+k9MPe/EeaA+NqgD"
Cancel-Lock: sha1:pXCkx6yUBwrCyM1L+O6ShxCe4Og=
 by: Mutt...@dastardlyhq.com - Mon, 13 Nov 2023 11:05 UTC

On Sun, 12 Nov 2023 12:24:25 -0500
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>In comp.unix.programmer Muttley@dastardlyhq.com wrote:
>> I'm a bit uncertain from the man page and from googling around whether
>> XDestroyImage() only frees the XImage structure created by XCreateImage()
>> or whether it also frees the user allocated memory that gets passed into
>> XCreateImage().
>
>The man page that I found describing the XDestroyImage macro says, quite
>prominently:
>
>"Note that when the image is created using XCreateImage(), XGetImage(),
>or XSubImage(), the destroy procedure that this macro calls frees both
>the image structure and the data pointed to by the image structure."
>
>Does the manpage you viewed lack that statement?

Yes. All it says is:

"The XDestroyImage function deallocates the memory associated with the
XImage structure."

Which is ambiguous.

Re: XDestroyImage()

<uisvvk$kdq5$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10865&group=comp.unix.programmer#10865

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mutt...@dastardlyhq.com
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: XDestroyImage()
Date: Mon, 13 Nov 2023 11:06:28 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <uisvvk$kdq5$1@dont-email.me>
References: <uiqsp7$54ll$1@dont-email.me> <K084N.102$ayBd.16@fx07.iad>
Injection-Date: Mon, 13 Nov 2023 11:06:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="99481a517071d6aa430244b9f982749e";
logging-data="669509"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19YMjuPDQEQu5typlaVL681"
Cancel-Lock: sha1:GYc0e0422+Mwwx0k22taU8zOGJU=
 by: Mutt...@dastardlyhq.com - Mon, 13 Nov 2023 11:06 UTC

On Sun, 12 Nov 2023 17:34:34 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Muttley@dastardlyhq.com writes:
>>Hello
>>
>>I'm a bit uncertain from the man page and from googling around whether
>>XDestroyImage() only frees the XImage structure created by XCreateImage()
>>or whether it also frees the user allocated memory that gets passed into
>>XCreateImage().
>>
>>Anyone know?
>
>Kalevi answered.
>
>To obtain an answer this question you could have run the application under
>valgrind - it would tell you about any memory that hadn't been
>deallocated at exit (using the leak check option).

I'd have to install valgrind first. Life's too short.

Re: XDestroyImage()

<eRq4N.33004$BbXa.15497@fx16.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10866&group=comp.unix.programmer#10866

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx16.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: XDestroyImage()
Newsgroups: comp.unix.programmer,comp.windows.x
References: <uiqsp7$54ll$1@dont-email.me> <K084N.102$ayBd.16@fx07.iad> <uisvvk$kdq5$1@dont-email.me>
Lines: 26
Message-ID: <eRq4N.33004$BbXa.15497@fx16.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Mon, 13 Nov 2023 14:59:22 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Mon, 13 Nov 2023 14:59:22 GMT
X-Received-Bytes: 1433
 by: Scott Lurndal - Mon, 13 Nov 2023 14:59 UTC

Muttley@dastardlyhq.com writes:
>On Sun, 12 Nov 2023 17:34:34 GMT
>scott@slp53.sl.home (Scott Lurndal) wrote:
>>Muttley@dastardlyhq.com writes:
>>>Hello
>>>
>>>I'm a bit uncertain from the man page and from googling around whether
>>>XDestroyImage() only frees the XImage structure created by XCreateImage()
>>>or whether it also frees the user allocated memory that gets passed into
>>>XCreateImage().
>>>
>>>Anyone know?
>>
>>Kalevi answered.
>>
>>To obtain an answer this question you could have run the application under
>>valgrind - it would tell you about any memory that hadn't been
>>deallocated at exit (using the leak check option).
>
>I'd have to install valgrind first. Life's too short.
>

sudo apt -y install valgrind
yum install valgrind

not too short for that.

Re: XDestroyImage()

<uith0j$n6fr$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10867&group=comp.unix.programmer#10867

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mutt...@dastardlyhq.com
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: XDestroyImage()
Date: Mon, 13 Nov 2023 15:57:07 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <uith0j$n6fr$1@dont-email.me>
References: <uiqsp7$54ll$1@dont-email.me> <K084N.102$ayBd.16@fx07.iad> <uisvvk$kdq5$1@dont-email.me> <eRq4N.33004$BbXa.15497@fx16.iad>
Injection-Date: Mon, 13 Nov 2023 15:57:07 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="99481a517071d6aa430244b9f982749e";
logging-data="760315"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AEI+PDq+PF/6RY8OGqq4L"
Cancel-Lock: sha1:5O5TRVid9gRmez0eEQuWxFlkR24=
 by: Mutt...@dastardlyhq.com - Mon, 13 Nov 2023 15:57 UTC

On Mon, 13 Nov 2023 14:59:22 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Muttley@dastardlyhq.com writes:
>>On Sun, 12 Nov 2023 17:34:34 GMT
>>scott@slp53.sl.home (Scott Lurndal) wrote:
>>>Muttley@dastardlyhq.com writes:
>>>>Hello
>>>>
>>>>I'm a bit uncertain from the man page and from googling around whether
>>>>XDestroyImage() only frees the XImage structure created by XCreateImage()
>>>>or whether it also frees the user allocated memory that gets passed into
>>>>XCreateImage().
>>>>
>>>>Anyone know?
>>>
>>>Kalevi answered.
>>>
>>>To obtain an answer this question you could have run the application under
>>>valgrind - it would tell you about any memory that hadn't been
>>>deallocated at exit (using the leak check option).
>>
>>I'd have to install valgrind first. Life's too short.
>>
>
>sudo apt -y install valgrind
>yum install valgrind
>
>not too short for that.

fenris$ yum
-bash: yum: command not found

Its a Mac so I'd probably have to piss about with Brew. Like I said, lifes
too short.

Re: XDestroyImage()

<ydh6lpegrh.fsf@UBEblock.psr.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10868&group=comp.unix.programmer#10868

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wbe...@UBEBLOCK.psr.com.invalid (Winston)
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: XDestroyImage()
Date: Mon, 13 Nov 2023 11:53:54 -0500
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <ydh6lpegrh.fsf@UBEblock.psr.com>
References: <uiqsp7$54ll$1@dont-email.me> <uir1o9$5nkq$1@dont-email.me>
<uisvuj$kdn3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="912960bf1ad8eb9fdba45ea9d9ac147f";
logging-data="777067"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Oq1KRECK+mwVl9nOFbuer"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (berkeley-unix)
Cancel-Lock: sha1:8Tfclquu5/hxsY1CLrF+gQkEnaU=
sha1:XLInCrqbjiQ972bUwVPTBeG0n+Y=
Mail-Copies-To: never
 by: Winston - Mon, 13 Nov 2023 16:53 UTC

Muttley@dastardlyhq.com writes:
> On Sun, 12 Nov 2023 12:24:25 -0500
> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>>In comp.unix.programmer Muttley@dastardlyhq.com wrote:
>>> I'm a bit uncertain from the man page and from googling around whether
>>> XDestroyImage() only frees the XImage structure created by XCreateImage()
>>> or whether it also frees the user allocated memory that gets passed into
>>> XCreateImage().
>>
>>The man page that I found describing the XDestroyImage macro says, quite
>>prominently:
>>
>>"Note that when the image is created using XCreateImage(), XGetImage(),
>>or XSubImage(), the destroy procedure that this macro calls frees both
>>the image structure and the data pointed to by the image structure."
>>
>>Does the manpage you viewed lack that statement?
>
> Yes. All it says is:
>
> "The XDestroyImage function deallocates the memory associated with the
> XImage structure."
>
> Which is ambiguous.

Check your man page again. Yes, the description of XDestroyImage just
before SEE ALSO says only what you quoted, but, on my libX11 1.8.7
version of the man page, the paragraph James quoted ("Note that ...") is
above, at the 5th paragraph, right after the XCreateImage paragraph.
-WBE

Re: XDestroyImage()

<871qctfnuo.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10869&group=comp.unix.programmer#10869

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: XDestroyImage()
Date: Mon, 13 Nov 2023 11:35:27 -0800
Organization: None to speak of
Lines: 53
Message-ID: <871qctfnuo.fsf@nosuchdomain.example.com>
References: <uiqsp7$54ll$1@dont-email.me> <uir1o9$5nkq$1@dont-email.me>
<uisvuj$kdn3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="84428a78f4afd9e40bf8639aa2c3c323";
logging-data="922118"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19HXWdZmdTKXoKupIEwFg9N"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:C63SPCxJb/tDslPJgp9H7OokPrs=
sha1:0MWEf/JTjE2obxXrcRpCQMjWUNg=
 by: Keith Thompson - Mon, 13 Nov 2023 19:35 UTC

Muttley@dastardlyhq.com writes:
> On Sun, 12 Nov 2023 12:24:25 -0500
> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>>In comp.unix.programmer Muttley@dastardlyhq.com wrote:
>>> I'm a bit uncertain from the man page and from googling around whether
>>> XDestroyImage() only frees the XImage structure created by XCreateImage()
>>> or whether it also frees the user allocated memory that gets passed into
>>> XCreateImage().
>>
>>The man page that I found describing the XDestroyImage macro says, quite
>>prominently:
>>
>>"Note that when the image is created using XCreateImage(), XGetImage(),
>>or XSubImage(), the destroy procedure that this macro calls frees both
>>the image structure and the data pointed to by the image structure."
>>
>>Does the manpage you viewed lack that statement?
>
> Yes. All it says is:
>
> "The XDestroyImage function deallocates the memory associated with the
> XImage structure."
>
> Which is ambiguous.

That's very surprising. Looking at a Git mirror of libX11
(https://github.com/mirror/libX11), that "Note that" paragraph appears
in every version of that man page going back to 2003 (X11R6.6).

On my system, Ubuntu 22.04, I get:

$ man XDestroyImage | wc -l
139
$ man XDestroyImage | tail -n 1
X Version 11 libX11 1.7.5 XCreateImage(3)
$ man XDestroyImage | sed -n '/Note that/,+3p'
Note that when the image is created using XCreateImage, XGetImage, or
XSubImage, the destroy procedure that the XDestroyImage function calls
frees both the image structure and the data pointed to by the image
structure.
$

What do you get on your system? (You mentioned that you're on a Mac.)

See also https://linux.die.net/man/3/xdestroyimage

(Note that the XDestroyImage man page is typically a symlink to the
XInitImage man page.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: XDestroyImage()

<65539c80$0$6432$426a74cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10870&group=comp.unix.programmer#10870

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-b.proxad.net!nnrp5-1.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$...@salle-s.org (Nicolas George)
Subject: Re: XDestroyImage()
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <uiqsp7$54ll$1@dont-email.me> <K084N.102$ayBd.16@fx07.iad> <uisvvk$kdq5$1@dont-email.me>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 14 Nov 2023 16:12:48 GMT
Lines: 5
Message-ID: <65539c80$0$6432$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 14 Nov 2023 17:12:48 CET
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1699978368 news-3.free.fr 6432 129.199.129.80:53426
X-Complaints-To: abuse@proxad.net
 by: Nicolas George - Tue, 14 Nov 2023 16:12 UTC

Muttley@dastardlyhq.com, dans le message <uisvvk$kdq5$1@dont-email.me>,
a écrit :
> I'd have to install valgrind first. Life's too short.

Life's too short to debug WITHOUT valgrind.

Re: XDestroyImage()

<87bkbvkxi6.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10871&group=comp.unix.programmer#10871

  copy link   Newsgroups: comp.unix.programmer comp.windows.x
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: XDestroyImage()
Date: Wed, 15 Nov 2023 12:32:33 +0000
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <87bkbvkxi6.fsf@bsb.me.uk>
References: <uiqsp7$54ll$1@dont-email.me> <uir1o9$5nkq$1@dont-email.me>
<uisvuj$kdn3$1@dont-email.me>
<871qctfnuo.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="ccccfc0a3fc15cbab510c5cd69629ac8";
logging-data="1838241"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX184F8sJaktR3lAlDkk5uKABVGMbWwI/gp0="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:1WoFIERX0wJZQxWDrP4zMBtM9L8=
sha1:49ls8hG3gVr2Jaiz8XCRm4o/Rp8=
X-BSB-Auth: 1.9724c08579a5283a7945.20231115123233GMT.87bkbvkxi6.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 15 Nov 2023 12:32 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Muttley@dastardlyhq.com writes:
>> On Sun, 12 Nov 2023 12:24:25 -0500
>> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>>>In comp.unix.programmer Muttley@dastardlyhq.com wrote:
>>>> I'm a bit uncertain from the man page and from googling around whether
>>>> XDestroyImage() only frees the XImage structure created by XCreateImage()
>>>> or whether it also frees the user allocated memory that gets passed into
>>>> XCreateImage().
>>>
>>>The man page that I found describing the XDestroyImage macro says, quite
>>>prominently:
>>>
>>>"Note that when the image is created using XCreateImage(), XGetImage(),
>>>or XSubImage(), the destroy procedure that this macro calls frees both
>>>the image structure and the data pointed to by the image structure."
>>>
>>>Does the manpage you viewed lack that statement?
>>
>> Yes. All it says is:
>>
>> "The XDestroyImage function deallocates the memory associated with the
>> XImage structure."
>>
>> Which is ambiguous.
>
> That's very surprising. Looking at a Git mirror of libX11
> (https://github.com/mirror/libX11), that "Note that" paragraph appears
> in every version of that man page going back to 2003 (X11R6.6).
>
> On my system, Ubuntu 22.04, I get:
>
> $ man XDestroyImage | wc -l
> 139
> $ man XDestroyImage | tail -n 1
> X Version 11 libX11 1.7.5 XCreateImage(3)
> $ man XDestroyImage | sed -n '/Note that/,+3p'
> Note that when the image is created using XCreateImage, XGetImage, or
> XSubImage, the destroy procedure that the XDestroyImage function calls
> frees both the image structure and the data pointed to by the image
> structure.
> $
>
> What do you get on your system? (You mentioned that you're on a Mac.)

Just as a random data point, on a Mac I have access to (but don't
understand well enough to say anything reliable about what software it
has installed) I get this:

$ man XDestroyImage | wc -l
140
$ man XDestroyImage | tail -n 1
X Version 11 libX11 1.5.0 XCreateImage(3)
$ man XDestroyImage | sed -n '/Note that/,+3p'
Note that when the image is created using XCreateImage, XGetImage, or
XSubImage, the destroy procedure that the XDestroyImage function calls
frees both the image structure and the data pointed to by the image
structure.

--
Ben.

Re: XDestroyImage()

<uj2vva$1r8a4$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10872&group=comp.unix.programmer#10872

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no...@thanks.net (candycanearter07)
Newsgroups: comp.unix.programmer
Subject: Re: XDestroyImage()
Date: Wed, 15 Nov 2023 11:35:57 -0600
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <uj2vva$1r8a4$2@dont-email.me>
References: <uiqsp7$54ll$1@dont-email.me> <K084N.102$ayBd.16@fx07.iad>
<uisvvk$kdq5$1@dont-email.me> <65539c80$0$6432$426a74cc@news.free.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 15 Nov 2023 17:43:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="17de4ea96d73da14512f6eba15cb3318";
logging-data="1941828"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18J9okFn9MnXMBW4j5RXam99fL/5OZajG7xaoB8JuoQOg=="
User-Agent: Betterbird (Linux)
Cancel-Lock: sha1:CaBA+W48plukXJaVzz/pdiJXi3g=
Content-Language: en-US
In-Reply-To: <65539c80$0$6432$426a74cc@news.free.fr>
 by: candycanearter07 - Wed, 15 Nov 2023 17:35 UTC

On 11/14/23 10:12, Nicolas George wrote:
> Muttley@dastardlyhq.com, dans le message <uisvvk$kdq5$1@dont-email.me>,
> a écrit :
>> I'd have to install valgrind first. Life's too short.
>
> Life's too short to debug WITHOUT valgrind.

And gdb is also pretty useful (if you compile with -ggdb).
--
user <candycane> is generated from /dev/urandom

Re: XDestroyImage()

<uj4l7a$26ki4$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10873&group=comp.unix.programmer#10873

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mutt...@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: XDestroyImage()
Date: Thu, 16 Nov 2023 08:51:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <uj4l7a$26ki4$1@dont-email.me>
References: <uiqsp7$54ll$1@dont-email.me> <K084N.102$ayBd.16@fx07.iad>
<uisvvk$kdq5$1@dont-email.me> <65539c80$0$6432$426a74cc@news.free.fr>
<uj2vva$1r8a4$2@dont-email.me>
Injection-Date: Thu, 16 Nov 2023 08:51:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="844d99e1a07ede99c6760978afb353ad";
logging-data="2314820"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7D6PTQWYiRLygyUAsBUxJ"
Cancel-Lock: sha1:cilgkV35z0DAFIX1umOA9sPns6A=
 by: Mutt...@dastardlyhq.com - Thu, 16 Nov 2023 08:51 UTC

On Wed, 15 Nov 2023 11:35:57 -0600
candycanearter07 <no@thanks.net> wrote:
>On 11/14/23 10:12, Nicolas George wrote:
>> Muttley@dastardlyhq.com, dans le message <uisvvk$kdq5$1@dont-email.me>,
>> a écrit :
>>> I'd have to install valgrind first. Life's too short.
>>
>> Life's too short to debug WITHOUT valgrind.
>
>And gdb is also pretty useful (if you compile with -ggdb).

-fsanitize=address is probably the most useful runtime debugging option in
recent times IMO.

Re: XDestroyImage()

<ujeihu$5tvk$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10874&group=comp.unix.programmer#10874

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no...@thanks.net (candycanearter07)
Newsgroups: comp.unix.programmer
Subject: Re: XDestroyImage()
Date: Sun, 19 Nov 2023 21:07:42 -0600
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <ujeihu$5tvk$2@dont-email.me>
References: <uiqsp7$54ll$1@dont-email.me> <K084N.102$ayBd.16@fx07.iad>
<uisvvk$kdq5$1@dont-email.me> <65539c80$0$6432$426a74cc@news.free.fr>
<uj2vva$1r8a4$2@dont-email.me> <uj4l7a$26ki4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 20 Nov 2023 03:07:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="77f586782b591e93665467661806e9cf";
logging-data="194548"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/m542h1wh9QOVQDuwY+oZxNExcoM0g7cTTtbxN4TM+Nw=="
User-Agent: Betterbird (Linux)
Cancel-Lock: sha1:ZkMH10dtUoHrtyaY2YqI2ORqUB4=
Content-Language: en-US
In-Reply-To: <uj4l7a$26ki4$1@dont-email.me>
 by: candycanearter07 - Mon, 20 Nov 2023 03:07 UTC

On 11/16/23 02:51, Muttley@dastardlyhq.com wrote:
> On Wed, 15 Nov 2023 11:35:57 -0600
> candycanearter07 <no@thanks.net> wrote:
>> On 11/14/23 10:12, Nicolas George wrote:
>>> Muttley@dastardlyhq.com, dans le message <uisvvk$kdq5$1@dont-email.me>,
>>> a écrit :
>>>> I'd have to install valgrind first. Life's too short.
>>>
>>> Life's too short to debug WITHOUT valgrind.
>>
>> And gdb is also pretty useful (if you compile with -ggdb).
>
> -fsanitize=address is probably the most useful runtime debugging option in
> recent times IMO.
>
>

True, I keep forgetting to add it tho
--
user <candycane> is generated from /dev/urandom

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor