Is System.Memory of any help?
/ Martin Nilsson (Hossnij)
Previous text:
2002-11-25 20:07: Subject: Direct memory access
Scenario: A chunk of memory allocated in C that if possible should be modified directly.
Is this at all possible in Pike? This is related to the discussion of the efficiency of especially the (planned) set_pixel/get_pixel methods in SDL, but not only.
The SDL problem is even tricker since, depending on bpp, you need to change 1, 2, 3 och 4 bytes at once. Since Pike only has (32 bit) 'signed int' this probably isn't viable.
Also, correct me if I'm wrong, no matter the method there would still be a method call for each access, unless there was a deeper, lower-level support in the interpreter for this?
In a way it's non-shared array support, where the accessed memory could be preallocated (SDL surface memory, mmap etc) or not.
Any comments would be welcome.
/ David Hedbor