From: sirjofri <sirjofri+ml-9front@sirjofri.de>
To: 9front@9front.org
Subject: Re: [9front] prof profiler changing program result
Date: Fri, 15 Dec 2023 11:21:07 +0100 (GMT+01:00) [thread overview]
Message-ID: <774b7167-1cec-47b6-9c06-bd631abb0ed7@sirjofri.de> (raw)
In-Reply-To: <CAGOW0YMMYgj8587bfUcuSKnYn+j51BrhcxMg67jTpFXXR97jfg@mail.gmail.com>
13.12.2023 04:30:51 Amavect <amavect@gmail.com>:
> On Sat, Dec 9, 2023 at 12:30 PM sirjofri <sirjofri+ml-9front@sirjofri.de> wrote:
>> today I did an implementation of mandelbrot and learned to use prof to profile my program.
>> I noticed that the mandelbrot result is different when linked using -p.
>> Instead of the nice mandelbrot image I get a circle (but still with lots of details).
>> Funnily enough, julia seems to work better.
> You have uninitialized variables.
> I guess kencc doesn't warn if you don't fully initialize a struct.
> Acid showed me that SetParams params was initialized differently by
> the time it reaches generate().
> The .julia field gets an uninitialized value of 0 without -p, and an
> uninitialized value of 1 with -p.
> After setting a zero struct initializer {0}, the mandelbrot generates correctly.
> After setting a struct initializer {1}, the mandelbrot generates
> incorrectly in the same way.
Good catch, I didn't think about that.
I fixed my program now and it works, thank you for pointing it out.
sirjofri
prev parent reply other threads:[~2023-12-15 10:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-09 18:29 sirjofri
2023-12-09 19:05 ` Steve Simon
2023-12-13 3:28 ` Amavect
2023-12-15 10:21 ` sirjofri [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=774b7167-1cec-47b6-9c06-bd631abb0ed7@sirjofri.de \
--to=sirjofri+ml-9front@sirjofri.de \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).