Linked Questions

-3 votes
1 answer
209 views

Objects are "passed by value" (and not "passed by reference" as some people may think) where the value is the reference. Just out of complete curiosity, is it possible to get the value of this ...
burnt1ce's user avatar
  • 15k
-1 votes
1 answer
614 views

I have a class called Person class Person { public string name; public int age; public Person(string name, int age) { this.name = name; this.age = age; } } I ...
gamerdev's user avatar
39 votes
5 answers
26k views

While i was looking at some legacy application code i noticed it is using a string object to do thread synchronization. I'm trying to resolve some thread contention issues in this program and was ...
Illuminati's user avatar
  • 4,659
12 votes
5 answers
23k views

I am trying to track down a bug in the mono runtime where a variable appears to be allocated to one valid object, and then is reassigned later to a bogus object, specifically //early in code I ...
evolvedmicrobe's user avatar
8 votes
3 answers
1k views

I am a C++ habitat working on a C# project. I have encountered the following situation. I have class MyClass and want to avoid any 2 objects of type MyClass ever to share a cache line even if I have ...
Eduard Rostomyan's user avatar
0 votes
6 answers
400 views

Consider this code: object str1 = "shahrooz"; object str2 = "shahrooz"; object int1 = 1; object int2 = 1; Console.WriteLine("str1 == str2 : " + (str1 == str2)); Console.WriteLine("int1 == int2 : " + ...
user avatar
4 votes
1 answer
4k views

I'd like to create a generic method that uses a pointer to an array of T where T could be a C# primitive, or a C# class. I was going along fine until I attempted the "T" part. Is there a way around ...
sgtz's user avatar
  • 9,049
3 votes
5 answers
273 views

Consider the following code: public static void Main() { string str1 = "abc"; string str2 = "abc"; if (str1 == str2) { Console.WriteLine("True"); } else { ...
Atul Sureka's user avatar
  • 3,332
4 votes
3 answers
1k views

Java's System.identityHashCode() Returns the same hash code for the given object as would be returned by the default method hashCode(), whether or not the given object's class overrides hashCode(...
Evgeniy Berezovsky's user avatar
1 vote
3 answers
1k views

There are many examples over the net how to get pointer to byte[] or int[,], i.e. when you know exactly the element type and rank of the array. But how to get the pointer for generic Array? The main ...
greenoldman's user avatar
  • 21.3k
3 votes
1 answer
2k views

In .Net Core how do you get the memory address (IntPtr) of a primitive field when the parent object is not known at compile time? If the object class was a struct and blittable then I could use ...
user425678's user avatar
2 votes
3 answers
834 views

I got following MemoryAddressExtenstion code, it shows object address in C# Want to know what is IntPtr** and **(IntPtr**) Thanks public static class MemoryAddressExtenstion { public static ...
Max CHien's user avatar
  • 143
1 vote
2 answers
2k views

I need to get memory address of loaded assemblies in my appdomain. When Assemblies are loaded in to a .Net app , they will be fully loaded in main application memory. If we search a memory for this ...
user avatar
2 votes
1 answer
297 views

I'm using the AddEventHandler method from that answer, but when doing it on an EventHandler with a value type argument that happens: using System.Reflection; public class Program { public static ...
KBar's user avatar
  • 100
2 votes
1 answer
1k views

Possible Duplicate: .NET unique object identifier Instead of re-inventing the wheel, is there a unique, immutable object ID I can access for each object instance in .NET? I'm asking this because ...
Ron Klein's user avatar
  • 9,520

15 30 50 per page