Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Memory mapped files.

10 views
Skip to first unread message

Thaddeus L Olczyk

unread,
Feb 3, 2002, 12:48:34 AM2/3/02
to
Is there a way of doing memory mapped files in Lisp?

Also, is there a way of overlaying structures on raw memory ala C
structs.

Ex:

At memory located at base:

base: integer
base+sizeof(int): foo
base+sizeof(int)+sizeof(foo): foo
base+sizeof(int)+2*sizeof(foo): foo
base+sizeof(int)+3*sizeof(foo): foo

struct foo
{
char bar[20];
int bar_len;
char bar_d[10];
int bar_d_len;
};

vector<foo> foo_list;
int num=*(int *)base;
int i;
foo *ptr=(foo *)(((int *)base)++);
for(i=0;i<num;i++)
{
foo a=*ptr++;
foo_list.push_back(a);
}


Wade Humeniuk

unread,
Feb 3, 2002, 1:02:21 AM2/3/02
to
Which implementation of Lisp? Most CLs have a FLI interface. They usually
can create a foreign type that maps to a C struct.

Wade

"Thaddeus L Olczyk" <olc...@interaccess.com> wrote in message
news:3c5cc77a....@nntp.interaccess.com...

Scott McKay

unread,
Feb 3, 2002, 8:47:01 AM2/3/02
to
In the absence of any other information, I would guess that you will
have to be careful of interactions with the GC when you do this. I
think Wade's question "what implementation?" is the key question.

"Wade Humeniuk" <hume...@cadvision.com> wrote in message
news:a3ijj9$7gr$1...@news3.cadvision.com...

0 new messages