[Mono-dev] Embedded: storing extra data on objects?

BGB cr88192 at hotmail.com
Mon Mar 30 22:02:33 EDT 2009


Embedded: storing extra data on objects?
  ----- Original Message ----- 
  From: David Mitchell 
  To: mono-devel-list at lists.ximian.com 
  Sent: Tuesday, March 31, 2009 2:49 AM
  Subject: [Mono-dev] Embedded: storing extra data on objects?


  When embedding mono, is there a way to store a little bit of extra information (pointer-sized) along with a MonoObject (or similar structure)?

  My scenario is that I have unmanaged wrappers for managed objects, and I'd like to ensure that there is never more than one unmanaged wrapper per object (and also be able to get the unmanaged wrapper if all I have is the object). I'm sure I know that I could use a hash table for this, and that may end up being what I do, but actually storing the pointer on the MonoObject seems more natural, in my case.

  A related question: if this isn't possible, would a patch to facilitate scenarios like mine be welcomed, or is it something that the community is thoroughly disinterested in?

  --Dave 

beyond a hash table, have you also considered whether it would make sense to put the pointer in an ordinary field (or slot/member/...), and then retrieve the value from the field as needed?...

(sorry, I am no expert on mono's internals, so I don't know how reasonable this is either...).




------------------------------------------------------------------------------


  _______________________________________________
  Mono-devel-list mailing list
  Mono-devel-list at lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090331/732a31ae/attachment.html 


More information about the Mono-devel-list mailing list