Skip to main content

Posts

Featured

  Understanding Ownership in Rust 1. Overview One of Rust's most distinctive features — and the one that sets it apart from virtually every other systems programming language — is its ownership system . Ownership is the mechanism through which Rust achieves memory safety without a garbage collector and without requiring the programmer to manually allocate and free memory. At compile time, the Rust compiler enforces a strict set of ownership rules. If any of these rules are violated, the program simply will not compile. This means that an entire class of bugs — use-after-free, double-free, dangling pointers, and data races — are impossible in safe Rust by construction. This post walks through the core concepts: ownership, moves, cloning, borrowing, and lifetimes, with concrete examples throughout. 2. The Three Rules of Ownership The ownership system is built on three fundamental rules: Every value in Rust has exactly one owner . There can only be one owner at a time . Whe...

Latest posts

Sealed Classes and Interfaces in Java.

The new features in Java 16

Transfer learning for Deep Neural Networks using TensorFlow.

Improving Lock Performance in Java.

Java 15 Features.

HashMap Vs. ConcurrentHashMap Vs. SynchronizedMap