<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Greg,<div><br></div><div>If I understand your question, the answer is contained in the sources for AREF and its specialized helper functions (try disassembling compiler output to see details of what is called).<div><br></div><div>There are several different array formats. I don’t know if you care about only one format or if you use the full generality if Lisp arrays. If you are not concerned about maximal performance, there <i>might</i> be <div>a C version of AREF you can call from your code. Otherwise study the sources and this will tell you how arrays are organized. There is certainly a header with the array type and dimensions followed by the array data itself. </div><div><br></div><div>The garbage collector (GC) needs to understand this format too, unless it is an array that <i>cannot</i> contain pointers. If you are <i>mutating</i> an array with pointers, I recommend you use pre-written (official CCL) accessors, so bugs in C don’t accidentally crash the Lisp v GC. </div><div><br><div dir="ltr">--Tim</div><div dir="ltr"><br><blockquote type="cite">On Feb 3, 2023, at 06:59, Grégory Vanuxem <g.vanuxem@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="auto">“Accessing already allocated arrays data”</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 3 févr. 2023 à 12:56, Grégory Vanuxem <<a href="mailto:g.vanuxem@gmail.com">g.vanuxem@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Hello,<div><br></div><div dir="auto">My question is simple, how can I obtain a MACPTR to array data? For usual data type it's easy from the documentation but for arrays I do not know how.</div><div dir="auto"><br></div><div dir="auto">I’m adding code to FriCAS (0), a fork of Axiom (1), and the creation of arrays I’ll use is already implemented. I just need to have direct access to memory, so, in C, an address to the data stored in Clozure CL arrays.</div><div dir="auto"><br></div><div dir="auto">I insist, FriCAS arrays are already implemented, I do not want to use (make-heap-ivector …) for example.</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto"><br></div><div dir="auto">Greg</div><div dir="auto"><br></div><div dir="auto"><div dir="auto">(0): <a href="https://fricas.github.io/" target="_blank">https://fricas.github.io/</a></div><div dir="auto">(1): http ://<a href="http://axiom-developer.org/" target="_blank">axiom-developer.org/</a></div><br></div>
</blockquote></div></div>
</div></blockquote></div></div></div></body></html>