<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 02/21/2014 09:00 AM, Ivica Bukvic
wrote:<br>
</div>
<blockquote
cite="mid:CAJrgGbZBfqmfZ=eSKf1+9BGyCDGsdz4JgiqHKLHxCERyAf1f9g@mail.gmail.com"
type="cite">
<p dir="ltr">Because this way you can reference data points with
sc_vec+n as opposed to dealing with single or double linked
lists (since sc_vec can be an array).</p>
</blockquote>
<br>
If sc_vec is a pointer then you can access data points using the
same technique, which is pointer math after all.<br>
<br>
For everyone's amusement, here's an exercise in my own rank
speculation: something about a t_word array aligning on boundaries
in a way that you wouldn't be able to guarantee with a pointer to a
t_word. So if you can guarantee there won't be padding you save
memory in 1981.<br>
<br>
Is it something like that, Miller?<br>
<br>
And do scalars actually go back to 1981, or that's just around the
time you learned the technique?<br>
<br>
Also-- this technique means that for sc_vec[1] its position inside
the struct suddenly become relevant. That is, if you put
sc_template as the last member field you'd be indexing into the
wrong place when you tried to read/write sc_vec data. Is that
right?<br>
<br>
-Jonathan<br>
<br>
<blockquote
cite="mid:CAJrgGbZBfqmfZ=eSKf1+9BGyCDGsdz4JgiqHKLHxCERyAf1f9g@mail.gmail.com"
type="cite">
<div class="gmail_quote">On Feb 21, 2014 7:26 AM, "Charles Goyard"
<<a moz-do-not-send="true" href="mailto:cg@fsck.fr">cg@fsck.fr</a>>
wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Sorry for this question, but why isn't sc_vec a good old
pointer ?<br>
<br>
> t_gobj sc_gobj; /* header for graphical
object */<br>
> t_symbol *sc_template; /* template name (LATER
replace with pointer) */<br>
> t_word sc_vec[1]; /* indeterminate-length array
of words */<br>
> } t_scalar;<br>
><br>
> How is a static t_word array of size 1 an
indeterminate-length array? Is its placement as the last
member of the struct required?<br>
<br>
_______________________________________________<br>
<a moz-do-not-send="true" href="mailto:Pd-list@iem.at">Pd-list@iem.at</a>
mailing list<br>
UNSUBSCRIBE and account-management -> <a
moz-do-not-send="true"
href="http://lists.puredata.info/listinfo/pd-list"
target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
<a class="moz-txt-link-abbreviated" href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list
UNSUBSCRIBE and account-management -> <a class="moz-txt-link-freetext" href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a>
</pre>
</blockquote>
<br>
</body>
</html>