On May 24, 2006, at 5:15 PM, Peter K. Stys wrote:

 dim m as MemoryBlock

Declare Function malloc lib "/usr/lib/libc.dylib" ( size as Integer ) as
Ptr

 m = malloc(1000)

 n = integer(m) <= error

Try something like this:

Declare Function malloc lib "System" ( size as integer ) as ptr

dim p as ptr = malloc( 1000 ) // p as a pointer to the allocated memory

// you can now do things like this:
// p.integer( 0 ) = 4
// p.uint16( 4 ) = 12345

dim m as Memoryblock = p // RB converts ptrs to memoryblocks automatically

m.stringValue( 0 ) = "some string"

You can use the pointer directly, but beware that it does not do bounds checking, endian swapping, etc.

Asher

-------------------------
Asher Dunn
Head Developer, Fireye Software
http://www.fireyesoftware.com/
AIM, Yahoo, MSN: crazedglkid


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to