<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I'm also a little unclear about exactly what it is you are trying to accomplish, but there is an %address-of function that does more or less what the name implies. But I'm guessing that what you really want is make-heap-ivector/dispose-heap-ivector.<div class=""><br class=""></div><div class="">rg<br class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 3, 2023, at 5:32 AM, Tim McNerney <<a href="mailto:mc@media.mit.edu" class="">mc@media.mit.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class="">Greg,<div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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 class="">might</i> be <div class="">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 class=""><br class=""></div><div class="">The garbage collector (GC) needs to understand this format too, unless it is an array that <i class="">cannot</i> contain pointers. If you are <i class="">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 class=""><br class=""><div dir="ltr" class="">--Tim</div><div dir="ltr" class=""><br class=""><blockquote type="cite" class="">On Feb 3, 2023, at 06:59, Grégory Vanuxem <<a href="mailto:g.vanuxem@gmail.com" class="">g.vanuxem@gmail.com</a>> wrote:<br class=""><br class=""></blockquote></div><blockquote type="cite" class=""><div dir="ltr" class=""><div dir="auto" class="">“Accessing already allocated arrays data”</div><div class=""><br class=""><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" class="">g.vanuxem@gmail.com</a>> a écrit :<br class=""></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 class=""><br class=""></div><div dir="auto" class="">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" class=""><br class=""></div><div dir="auto" class="">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" class=""><br class=""></div><div dir="auto" class="">I insist, FriCAS arrays are already implemented, I do not want to use (make-heap-ivector …) for example.</div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">Regards,</div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">Greg</div><div dir="auto" class=""><br class=""></div><div dir="auto" class=""><div dir="auto" class="">(0): <a href="https://fricas.github.io/" target="_blank" class="">https://fricas.github.io/</a></div><div dir="auto" class="">(1): http ://<a href="http://axiom-developer.org/" target="_blank" class="">axiom-developer.org/</a></div><br class=""></div>
</blockquote></div></div>
</div></blockquote></div></div></div></div></div></blockquote></div><br class=""></div></div></body></html>