Custom memory allocation in C# Part 17 — Hijacking methods on .NET 5 with modifying metadata curious thing

This is the seventeenth part of the Custom memory allocation series. For your convenience you can find other parts in the table of contents in Part 1 — Allocating object on a stack I was rewriting my method hijacking samples to .NET 5 and I found an interesting behavior. Let’s take this code: If you … Continue reading Custom memory allocation in C# Part 17 — Hijacking methods on .NET 5 with modifying metadata curious thing

Custom memory allocation in C# Part 16 — Hijacking new on Linux with .NET 5

This is the sixteenth part of the Custom memory allocation series. For your convenience you can find other parts in the table of contents in Part 1 — Allocating object on a stack I was recently asked if it’s possible to hijack the new operator in Linux. We’ve already seen that we can do it … Continue reading Custom memory allocation in C# Part 16 — Hijacking new on Linux with .NET 5

Custom memory allocation in C# Part 15 — Allocating object on a stack without unsafe

This is the fifteenth part of the Custom memory allocation series. For your convenience you can find other parts in the table of contents in Part 1 — Allocating object on a stack Last time we saw how to do unsafe operations without the unsafe keyword. This time we’ll allocate some reference type on a … Continue reading Custom memory allocation in C# Part 15 — Allocating object on a stack without unsafe

Custom memory allocation in C# Part 14 — Unsafe code without unsafe keyword

This is the fourteenth part of the Custom memory allocation series. For your convenience you can find other parts in the table of contents in Part 1 — Allocating object on a stack This whole series is about unsafe operations and manual memory managing. However, all the things I’ve shown can be done with no … Continue reading Custom memory allocation in C# Part 14 — Unsafe code without unsafe keyword

Types and Programming Languages Part 5 – Sleeping and measuring time

This is the fifth part of the Types and Programming Languages series. For your convenience you can find other parts in the table of contents in Part 1 — Do not return in finally How do you sleep in your application? There are multiple solutions, most of the times similar to Thread.Sleep which synchronously blocks … Continue reading Types and Programming Languages Part 5 – Sleeping and measuring time