This package implements a heap for 'common' data
in shared memory segments.
There is a garbage collector, and lisp data types.
See also: COM.INFORMATIMAGO.COMMON-LISP.HEAP.MEMORY
License:
AGPL3
Copyright Pascal J. Bourguignon 2004 - 2012
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program.
If not, see <http://www.gnu.org/licenses/>
|
(common-initialize memory) |
function |
DOES: Initialize the memory instance as a shared heap.
MEMORY: A subclass of COM.INFORMATIMAGO.COMMON-LISP.HEAP.MEMORY:MEMORY.
NOTE: MEMORY objects are byte-addressed, however the various
sized operations are only called on naturally aligned
addresses: a peek-uint64 will be called only with
addresses multiple of 8. (However, this heap usually
addresses 64-bit words, gc-store and gc-load convert
the heap addresses into the memory byte addresses, and
cvm-svoperate does similarly, but may address 8-bit,
16-bit, 32-bit or 64-bit words depending on the size
of the data types).
|
(defcommon symbol &optional value docstring) |
macro |
DOES: Defines a common variable, ie. a variable whose value
is stored in the common heap. Everytime the variable
is read, the value is copied from the common heap into
the lisp heap, and vice-versa everytime it's written.
SYMBOL: The name of the common variable. It'll be a symbol macro.
VALUE: The initial value copied to the common variable.
DOCSTRING: A variable documentation string attached to the SYMBOL.
NOTE: A common variable named *COMMON-VARIABLES* contains a list
of all common variables names (symbols).
NOTE: Copying is done taking into account circles.
The copying for the following object types is implemented:
(signed-byte 56)
single-float
nil
cons
character
string
symbol ; only the package and name
package ; only the name. keeps the list of common variables
; in the package.
|
(get-common symbol) |
function |
DOES: Copies the value of the common variable from the common heap
to the lisp heap and return this lisp value.
SYMBOL: The name of the common variable. It'll be a symbol macro.
|
(set-common symbol value) |
function |
DOES: Copies the given lisp VALUE into the common variable in
the common heap. Return this lisp value.
SYMBOL: The name of the common variable. It'll be a symbol macro.
VALUE: The lisp value to be copied into the common heap and
bound to the common variable.
|
(with-common-lock &body body) |
macro |
Execute the BODY with the *GC-MEMORY* locked with the WITH-MEMORY macro.