Re: [hwloc-users] Creating a D wrapper around hwloc

2010-04-17 Thread Fawzi Mohamed

Hi Jim Burnes,

if D is Digital Mars D 1.0 you might want to know that I already did a  
wrapper, and I am using it since quite some it is part of blip which  
is available with an apache 2.0 license.


http://dsource.org/projects/blip

ciao
Fawzi
On 16-apr-10, at 22:17, Jim Burnes wrote:


Hi,

I'm creating a D wrapper around hwloc and so far it's going well, but
I need some advice...

One of the last issues I running into is at link time.

Since a number of functions (especially in helper.h) are define as
"static __inline" they are essentially macros.  This is why they don't
appear in the compiled libraries.

I can make these available to D in several different ways, but I need
to know the true intent of marking them as "static __inline".

1. Are they marked that way simply to increase performance?
2. Are they marked that way to avoid some sort of thread safety issue?

If the answer is (1) then I can safely remove their "static __inline"
markup and compile them into the library.

If the answer is closer to (2) and you truly need them inlined into
the source code where they are referenced then I can create a template
mixin in D for them and include them like that.

This is a cool library.  Thanks for the extensive work.

J Burnes
___
hwloc-users mailing list
hwloc-us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users




Re: [hwloc-users] Creating a D wrapper around hwloc

2010-04-16 Thread Jim Burnes
Brice,

Thanks for the clarification.

Since I'm not familiar with them, do you happen to know the scoping of
static inlines?  Are they expanded using the current scope?  Are they
pure?

Since they aren't guaranteed to be available in the library I'll
implement them using templates, though it may make an automated
translator more challlenging.

I'll post when I'm done.

Thanks

JB
Thanks

Jim Burnes

On 4/16/10, Brice Goglin  wrote:
> Jim Burnes wrote:
>> I can make these available to D in several different ways, but I need
>> to know the true intent of marking them as "static __inline".
>>
>> 1. Are they marked that way simply to increase performance?
>>
>
> No.
>
>> 2. Are they marked that way to avoid some sort of thread safety issue?
>>
>
> No.
>
>> If the answer is (1) then I can safely remove their "static __inline"
>> markup and compile them into the library.
>>
>
> In the beginning, one reason was to have examples of easy traversal
> routines in the headers, so as to improve documentation a bit. It offers
> more features, shows developers how to implement them, without
> increasing the core library size, and without increasing the ABI size too.
>
>> This is a cool library.  Thanks for the extensive work.
>>
>
> Thanks!
>
> Brice
>
> ___
> hwloc-users mailing list
> hwloc-us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users
>


Re: [hwloc-users] Creating a D wrapper around hwloc

2010-04-16 Thread Brice Goglin
Jim Burnes wrote:
> I can make these available to D in several different ways, but I need
> to know the true intent of marking them as "static __inline".
>
> 1. Are they marked that way simply to increase performance?
>   

No.

> 2. Are they marked that way to avoid some sort of thread safety issue?
>   

No.

> If the answer is (1) then I can safely remove their "static __inline"
> markup and compile them into the library.
>   

In the beginning, one reason was to have examples of easy traversal
routines in the headers, so as to improve documentation a bit. It offers
more features, shows developers how to implement them, without
increasing the core library size, and without increasing the ABI size too.

> This is a cool library.  Thanks for the extensive work.
>   

Thanks!

Brice