Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Human beings were created by water to transport it uphill.


devel / comp.lang.ada / pragmas in doubly linked lists

SubjectAuthor
* pragmas in doubly linked listsL. B.
`* pragmas in doubly linked listsNiklas Holsti
 `* pragmas in doubly linked listsMario Blunk
  `- pragmas in doubly linked listsMario Blunk

1
pragmas in doubly linked lists

<823bfde7-adb3-4cd2-adca-744cf676864an@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=8852&group=comp.lang.ada#8852

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ae9:e40a:0:b0:702:2939:8cf5 with SMTP id q10-20020ae9e40a000000b0070229398cf5mr1863694qkc.75.1674757505384;
Thu, 26 Jan 2023 10:25:05 -0800 (PST)
X-Received: by 2002:a9d:1af:0:b0:684:e916:34fb with SMTP id
e44-20020a9d01af000000b00684e91634fbmr2064872ote.178.1674757505169; Thu, 26
Jan 2023 10:25:05 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Thu, 26 Jan 2023 10:25:04 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=87.143.117.164; posting-account=3zVVBwoAAAC7BSMfgNP7DSbqU9urpt40
NNTP-Posting-Host: 87.143.117.164
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <823bfde7-adb3-4cd2-adca-744cf676864an@googlegroups.com>
Subject: pragmas in doubly linked lists
From: mario.blunk.gplus@gmail.com (L. B.)
Injection-Date: Thu, 26 Jan 2023 18:25:05 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1448
 by: L. B. - Thu, 26 Jan 2023 18:25 UTC

Hello,

I'm having issues with cursors of doubly linked lists (erroneous memory access exceptions).
So I'm wondering whether the pragmas might solve the problems. What is the purpose of the pragmas defined in the package like

pragma Preelaborate(Doubly_Linked_Lists);
pragma Preelaborable_Initialization(List);
pragma Preelaborable_Initialization(Cursor);

What are they good for and how to use them ? Some simple examples would be very helpful. Thank you.

Re: pragmas in doubly linked lists

<k3ibmiFodb6U1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=8856&group=comp.lang.ada#8856

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.holsti@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.lang.ada
Subject: Re: pragmas in doubly linked lists
Date: Fri, 27 Jan 2023 18:16:18 +0200
Organization: Tidorum Ltd
Lines: 37
Message-ID: <k3ibmiFodb6U1@mid.individual.net>
References: <823bfde7-adb3-4cd2-adca-744cf676864an@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net qutU6Bin5I4M+mFICecI0g3KUpcOS813TDq+39Q083ihc9FLDK
Cancel-Lock: sha1:4SuctW0sQodOM4o1oq0ziQm67nA=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0)
Gecko/20100101 Thunderbird/102.6.1
Content-Language: en-US
In-Reply-To: <823bfde7-adb3-4cd2-adca-744cf676864an@googlegroups.com>
 by: Niklas Holsti - Fri, 27 Jan 2023 16:16 UTC

On 2023-01-26 20:25, L. B. wrote:
> Hello,
>
> I'm having issues with cursors of doubly linked lists (erroneous
> memory access exceptions).

Sounds like a rather common programming error, perhaps trying to
dereference pointers that are null.

> So I'm wondering whether the pragmas might solve the problems.

That is very unlikely, IMO.

> What is the purpose of the pragmas defined in the package like
>
> pragma Preelaborate(Doubly_Linked_Lists);
> pragma Preelaborable_Initialization(List);
> pragma Preelaborable_Initialization(Cursor);

They tell the Ada compiler that the named package and the named types
will and should have very simple initialization requirements (default
initialization, for the types). They have no (visible) effect on how the
program executes and, AIUI, cannot be related to your memory access
exceptions.

For more explanation, see the Ada RM,
http://www.ada-auth.org/standards/22rm/html/RM-10-2-1.html.

If you would like help on the memory access exceptions, do describe the
problem more in detail here, and perhaps someone can help.

Re: pragmas in doubly linked lists

<181c7bf4-d3f8-47dd-b9b6-1e8301c46a12n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=8885&group=comp.lang.ada#8885

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:341:b0:3e4:e17f:a544 with SMTP id r1-20020a05622a034100b003e4e17fa544mr5393688qtw.12.1680108399781;
Wed, 29 Mar 2023 09:46:39 -0700 (PDT)
X-Received: by 2002:a81:b149:0:b0:543:9065:b225 with SMTP id
p70-20020a81b149000000b005439065b225mr9817198ywh.5.1680108399571; Wed, 29 Mar
2023 09:46:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 29 Mar 2023 09:46:39 -0700 (PDT)
In-Reply-To: <f2479eb0-4fa6-4cc6-9cbe-eb94900adfacn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=87.155.203.225; posting-account=3zVVBwoAAAC7BSMfgNP7DSbqU9urpt40
NNTP-Posting-Host: 87.155.203.225
References: <823bfde7-adb3-4cd2-adca-744cf676864an@googlegroups.com>
<k3ibmiFodb6U1@mid.individual.net> <5176a59b-9224-45a0-a803-df1acf8ab8c7n@googlegroups.com>
<a2e4dd42-6adb-415b-8baa-379a2b42439cn@googlegroups.com> <a237856d-89ad-4b88-9313-265baff2bab4n@googlegroups.com>
<f2479eb0-4fa6-4cc6-9cbe-eb94900adfacn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <181c7bf4-d3f8-47dd-b9b6-1e8301c46a12n@googlegroups.com>
Subject: Re: pragmas in doubly linked lists
From: mario.blunk.gplus@gmail.com (Mario Blunk)
Injection-Date: Wed, 29 Mar 2023 16:46:39 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1787
 by: Mario Blunk - Wed, 29 Mar 2023 16:46 UTC

I've put together some examples to reproduce the problem in:
https://github.com/Blunk-electronic/ada_training/tree/master/src/containers/lists/lists_of_cursors
But, everything behaves as it should.

The examples store cursors of a single list. In another example (to follow in the next days) I will use multiple lists. Then the list of cursors contains cursors of more than one list.

Re: pragmas in doubly linked lists

<a07e95df-31e3-476e-87d6-a64ba8858326n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=8973&group=comp.lang.ada#8973

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ad4:5504:0:b0:5ea:25e:7b76 with SMTP id pz4-20020ad45504000000b005ea025e7b76mr240354qvb.1.1681888642664;
Wed, 19 Apr 2023 00:17:22 -0700 (PDT)
X-Received: by 2002:a25:3a04:0:b0:b96:7fb0:f927 with SMTP id
h4-20020a253a04000000b00b967fb0f927mr899431yba.12.1681888642457; Wed, 19 Apr
2023 00:17:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!peer02.ams4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 19 Apr 2023 00:17:22 -0700 (PDT)
In-Reply-To: <181c7bf4-d3f8-47dd-b9b6-1e8301c46a12n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=87.143.122.5; posting-account=3zVVBwoAAAC7BSMfgNP7DSbqU9urpt40
NNTP-Posting-Host: 87.143.122.5
References: <823bfde7-adb3-4cd2-adca-744cf676864an@googlegroups.com>
<k3ibmiFodb6U1@mid.individual.net> <5176a59b-9224-45a0-a803-df1acf8ab8c7n@googlegroups.com>
<a2e4dd42-6adb-415b-8baa-379a2b42439cn@googlegroups.com> <a237856d-89ad-4b88-9313-265baff2bab4n@googlegroups.com>
<f2479eb0-4fa6-4cc6-9cbe-eb94900adfacn@googlegroups.com> <181c7bf4-d3f8-47dd-b9b6-1e8301c46a12n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a07e95df-31e3-476e-87d6-a64ba8858326n@googlegroups.com>
Subject: Re: pragmas in doubly linked lists
From: mario.blunk.gplus@gmail.com (Mario Blunk)
Injection-Date: Wed, 19 Apr 2023 07:17:22 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1712
 by: Mario Blunk - Wed, 19 Apr 2023 07:17 UTC

There is a demo program that reproduces a strange behavior. It could be related to the issue above. See:
https://groups.google.com/g/comp.lang.ada/c/eOtyCu7dQ_c/m/3drS5DHuBQAJ

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor