Re: Flat Short of MEMORY_BLOCK
"Brian Heilig" <Brian.Heilig-tdt4z+Mb/[email protected]>
| Newsgroups | gmane.comp.lang.eiffel.gobo.general |
|---|---|
| Message-ID | <[email protected]> |
> Eric Bezault wrote: > The restriction is that we don't want to force people to have > a C compiler in order to use Gobo Is inline c acceptable? > ... ISE's MANAGED_POINTER already provides some basic stuff ... > MEMORY_CELL would probably do the trick for VE although I > didn't look for a way to allocate memory from Eiffel in VE. > What about SE? I guess NATIVE_ARRAY can play the same kind > of trick as VE's MEMORY_CELL thanks to NATIVE_ARRAY.from_pointer > although I never understood how SE's GC handles the pointer > held in NATIVE_ARRAY (e.g. when it's owned or not). I didn't find a class MEMORY_CELL in VE, maybe Alexander was proposing this class as an implementation. Here is a synopsis for allocating and freeing memory in the three compilers: --- VE from class RTS_SERVER allocate_memory (size: INTEGER): POINTER release_memory (p: POINTER) --- ISE from class POINTER_REF memory_alloc (a_size: INTEGER): POINTER memory_free --- SE from expanded class NATIVE_ARRAY calloc(nb_elements: INTEGER): like Current As Eric said I don't know how SE handles freeing the memory. I assume calling these features produces a pointer that is safe to pass to external routines (e.g. immobile). Next as a minimum we need to poke and peek an 8-bit integer to a memory location. All other features can be implemented in terms of these two: --- VE from class MEMORY mem_copy (dest, source : POINTER; bytes_number : INTEGER) --- SE from class NATIVE_ARRAY put(element: E; index: INTEGER) --- ISE from class POINTER_REF memory_copy (a_source: POINTER; a_size: INTEGER) This is how ISE's MANAGED_POINTER implements it. Next up...I'd like to summarise the various implementations of this data type from ePosix, ISE, ECLI, Fenestra, and EWG_MANAGED_POINTER. Brian ------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511 http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/saFolB/TM ---------------------------------------------------------------------~-> To Post a message, send it to: [email protected] To Unsubscribe, send a blank message to: [email protected] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/gobo-eiffel/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/