FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
New since the initial 10.0 release.

get-objects

Arguments: code &key old new

This function takes one required argument and two keyword arguments. It returns a heapwalk vector, which is defined below. Its return value is suitable as the required argument to the related function get-references. Here is more about the arguments:

Since both new and old default to true, if neither is specified, both old and new space will be searched.

Here is a (slightly truncated) output of (room t):

cl-user(2): (room t)
area area  address(bytes)        cons         other bytes
  #  type                   8 bytes each
                             (free:used)      (free:used)
     Top #x20d7a000
     New #x20994000(4087808)   916:15225     843936:3035024
     New #x205ae000(4087808)    -----            -----
   0 Old #x20000aa0(5952864)   711:78771    2098888:3209704
Root pages: 126
  Lisp heap:    #x20000000  pos: #x20d7a000 resrve: #x20fa0000
Aclmalloc heap: #xa0000000  pos: #xa0048000 resrve: #xa00fa000
 Pure space:    #x1f8ec000  end: #x1ffff888

code   type                                 items     bytes 
126: (simple-array (unsigned-byte 16))       10767   2153400 31.4%
112: (simple-array t)                         8891   1445976 21.1%
  1: cons                                    93996    751968 11.0%
  7: symbol                                  20360    651520  9.5%
  8: function                                 9681    602864  8.8%
133: sv-vector                               20549    340840  5.0%
120: (simple-array fixnum)                     259    270272  3.9%
119: (simple-array code)                       367    192064  2.8%
117: (simple-array character)                 2396    148960  2.2%
125: (simple-array (unsigned-byte 8))           19     98720  1.4%
 12: standard-instance                        3900     62400  0.9%
  9: closure                                  2897     50432  0.7%
 15: structure                                1159     47856  0.7%
127: (simple-array (unsigned-byte 32))          11     12744  0.2%
[...]

 total bytes = 6856032
aclmalloc arena:
[...]

The type codes are given in the first column: 112 for (simple-array t (*)), 117 for strings (also known as (simple-array character)), and 127 for (simple-array (unsigned-byte 32)). We use 127 in the example below.

get-objects returns a heapwalk vector, which is a simple vector of type t whose first element is the number of objects of the specified type which were found, whose next elements are the objects found, and whose last elements are unspecified (the vector is made somewhat bigger than is necessary). Here is an example where we find objects of typecode 127, which is the code for (simple-array (unsigned-byte 32)).:

cl-user(3): (get-objects 127)
#(11 #(255 65535 16777215 4294967295) #(32 8224 2105376 538976288)
  #(3960924350 2165561044 562617442 2270225120 1264129478 758582028 172407450
    2782512936 595962478 1609675396 ...)
  #(0 2567483615)
  #(546914304 4087808 916 15225 529448960 536869000 553254912 536870912 843936
    3035024 ...)
  #(3960924350 2165561044 562617442 2270225120 1264129478 758582028 172407450
    2782512936 595962478 1609675396 ...)
  #(3960924350 2165561044 562617442 2270225120 1264129478 758582028 172407450
    2782512936 595962478 1609675396 ...)
  #(200235464 1375865383 2472949741 3729159793 443451277 421802134 4188904507
    2175392005 408067652 1254986169 ...)
  #(3960924350 2165561044 562617442 2270225120 1264129478 758582028 172407450
    2782512936 595962478 1609675396 ...)
  ...)
cl-user(4): (length *)
31
cl-user(5):

The result is a heapwalk vector. The first element is 11, the number of objects of the type of interest. Then those eleven objects. Then some extra elements (19 extra in this case, for a total vector size of 31).

The objects in the heapwalk vector returned by get-objects (that is, the elements with indices 1 through (+ 1 (aref hwvec 0)), where hwvec is the heapwalk vector) are suitable as the required argument to get-references.

See Heap walkers in Allegro CL for more information.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page is new in the 10.0 release.
Created 2016.6.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
New since the initial 10.0 release.