[Pharo-users] NativeBoost pointer and "+"

2015-06-08 Thread Matthieu Lacaton
Hello everyone, I have a small question about NativeBoost : How does the "+" operator when applied to a pointer translates into NativeBoost code ? To give a bit of context, what I want to do is to reallocate some non-contiguous bytes in memory to a buffer. Basically, I have an array of integers i

Re: [Pharo-users] NativeBoost pointer and "+"

2015-06-08 Thread Henrik Johansen
> On 08 Jun 2015, at 4:41 , Matthieu Lacaton wrote: > > Hello everyone, > > I have a small question about NativeBoost : How does the "+" operator when > applied to a pointer translates into NativeBoost code ? > > To give a bit of context, what I want to do is to reallocate some > non-contig

Re: [Pharo-users] NativeBoost pointer and "+"

2015-06-09 Thread Matthieu Lacaton
Hello Henrik, Thank you very much for your answer. However, the code you provided is some sort of assembly right ? So does it mean that I need to learn assembly to do what I want ? I'm asking that because I don't know anything about assembly so it will take me some time to learn. Cheers, Matthi

Re: [Pharo-users] NativeBoost pointer and "+"

2015-06-09 Thread Henrik Johansen
There are many ways to Rome :) If you just need some externally allocated objects in the formats you specified you can do the cache extraction using nothing but normal Smalltalk: intArray := (NBExternalArray ofType: 'int'). data := intArray new: 1000. 1 to:data size do:[:i |data at:i put: i]. ca

Re: [Pharo-users] NativeBoost pointer and "+"

2015-06-09 Thread Henrik Johansen
> On 09 Jun 2015, at 2:59 , Henrik Johansen > wrote: > > MyClass createCacheOf: data in: cache. Forgot to change this; you need to pass in the ExternalArray addresses as parameters, not the ExternalArrays themselves. MyClass createCacheOf: data address in: cache address Cheers, Henry

Re: [Pharo-users] NativeBoost pointer and "+"

2015-06-09 Thread Igor Stasenko
As i understand, in general, the problem that you described is in following: - you want to pass an address of your buffer contents, but started not from very first element of your buffer, but somewhere inside a buffer. In smalltalk you cannot reference an element of array, only the object (array i

Re: [Pharo-users] NativeBoost pointer and "+"

2015-06-09 Thread stepharo
Henrik you amaze me :) Stef Le 9/6/15 14:59, Henrik Johansen a écrit : There are many ways to Rome :) If you just need some externally allocated objects in the formats you specified you can do the cache extraction using nothing but normal Smalltalk: intArray := (NBExternalArray ofType: 'in

Re: [Pharo-users] NativeBoost pointer and "+"

2015-06-09 Thread Matthieu Lacaton
*@ Igor* > As i understand, in general, the problem that you described is in > following: > - you want to pass an address of your buffer contents, but started not from > very first element of your buffer, but somewhere inside a buffer. Yes ! Exactly that. I'm bad at explaining things :( Unfor

Re: [Pharo-users] NativeBoost pointer and "+"

2015-06-09 Thread Igor Stasenko
On 9 June 2015 at 20:05, Matthieu Lacaton wrote: > *@ Igor* > > >> As i understand, in general, the problem that you described is in >> following: >> - you want to pass an address of your buffer contents, but started not >> from >> very first element of your buffer, but somewhere inside a buffer.