Re: [Mono-devel-list] Limiting Memory Allocation

2005-04-15 Thread Ben Maurer
On Thu, 2005-04-14 at 23:50 +0100, Jim Purbrick wrote:
 I'm currently working on embeding Mono in a virtual
 world to support user scripting and would like to
 limit the ammount of memory each script object can
 allocate. I'd like to be able to intercept each heap
 allocation and decide whether to allow it on a
 per-script (object) basis. Is this possible? What's
 the best approach?

It is quite possible to intercept each allocation with our profiling
api. However, you can't disallow an allocation. I guess you could hack
the runtime to allow you to throw an OOM exception.

-- Ben

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] Need help to enhance oracle datetime parameter support...

2005-04-15 Thread Hubert FONGARNAND
Hi,

I want to enhance oracle datetime parameter support. Today, 
oracledatetime 
parameter is sended as a string to the oracle server... It's not the way that 
MS.NET does...
MS.NET send the datetime in a byte array. This method don't depend on the 
NLS_DATE_FORMAT parameter.
I think it would be better if mono use this method.

There's a OCI method to do that : OCIDateTimeToArray
So i've imported OCIDateTimeToArray and OCIDateTimeFromText in OCICalls.cs :

internal static int OCIDateTimeToArray (IntPtr hndl,
IntPtr errhp, IntPtr datetime, IntPtr interval, byte[] 
outarray, [MarshalAs 
(UnmanagedType.U4)] out int length, uint fsprec)
{
return 
OciNativeCalls.OCIDateTimeToArray(hndl,errhp,datetime,interval,outarray, out 
length,fsprec);
}


internal static int OCIDateTimeFromText (IntPtr hndl,
IntPtr errhp, [In][Out] byte[] date_str, uint 
dstr_length,
[In][Out] byte[] fmt, uint fmt_length,
[In][Out] byte[] lang_name,uint lang_length, IntPtr 
datetime)
{
return 
OciNativeCalls.OCIDateTimeFromText(hndl,errhp,date_str,dstr_length,fmt,fmt_length,lang_name,lang_length,datetime);
}

We must :
-create a OCIDateTime structure with the sDate String (with 
OCIDateTimeFromText)
-convert this OCIDateTime structure to a byte array with (OCIDateTimeToArray)

but i don't know how to allocate a OCIDateTime Structure in managed code...
Could you help me to implement that

Hubert FONGARNAND


___
Ce message et les éventuels documents joints peuvent contenir des informations 
confidentielles.
Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir 
le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce 
message non conforme à sa destination, toute diffusion ou publication, totale 
ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'étant pas sécurisées, l'intégrité de ce 
message n'est pas assurée et la société émettrice ne peut être tenue pour 
responsable de son contenu.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] Unions in C#, and the Bug# 58798 in GDA

2005-04-15 Thread Daniel Espinosa
I found that Gtk# use a series of perl script as well as C# program
called CodeGenerator, to auto-generate C# code from the sources.

In the case of Gda#, theres a definition of a fundamental type called
GdaValue, wich in his definition has a union (like in GValue struct),
but the parser and CodeGenerator, don't have support to generate a C#
representative of a union.

You know, in C# doesn't exist unions, but you can use the FieldOffset
attribute at cero, to have a in memory representation of a union. The
actual definition of GdaValue and correct code representation in C#
can be found the report and comments of the bug# 58798.

The the parser (a perl script called gapi-parser and the sub scripts,
specialy the api2xml) need generate a correcto XML file representation
for a union, and need be modified the C# code for CodeGenerator to
work around.

I'll try to help in any form, but I'm not a expert in perl or C#; but
I think it's very important to have Gda# working in Mono.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] Passing Lists To Unmanaged Code

2005-04-15 Thread Jim Purbrick
I'm currently embedding mono in a virtual world to
support user scripting. The managed scripts need to
call library functions implemented in unmanaged code
that take or return lists. Is it possible to pass
lists across the managed/unmanaged boundary? If so,
what's the best way to do it? A lot of the
documentation on interoperation suggests that this
might be hard or impossible.

Cheers,

Jim.

Send instant messages to your online friends http://uk.messenger.yahoo.com 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list