---
title: "Discussion on \"Zero-Cost Types? The Fine Print on Kotlin Value Classes\" | Hashnode"
description: "Discussion on \"Zero-Cost Types? The Fine Print on Kotlin Value Classes\". Learn when Kotlin value classes avoid heap allocation, when boxing returns, and how name mangling affects Room, Retrofit, serialization and Java."
url: "https://hashnode.com/posts/zero-cost-types-the-fine-print-on-kotlin-value-classes/6af4a07c1efa3ee1bac4e75f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Zero-Cost Types? The Fine Print on Kotlin Value Classes](https://android-expert.hashnode.dev/zero-cost-types-the-fine-print-on-kotlin-value-classes?utm_source=hashnode&utm_medium=feed)

Learn when Kotlin value classes avoid heap allocation, when boxing returns, and how name mangling affects Room, Retrofit, serialization and Java.

6h ago · 12 min read · android-expert.hashnode.dev  
Read the article

-   [#value-classes](https://hashnode.com/tag/value-classes)
-   [#jetpack-compose](https://hashnode.com/tag/jetpack-compose)
-   [#kotlin-performance](https://hashnode.com/tag/kotlin-performance)
-   [#type-safety](https://hashnode.com/tag/type-safety)
-   [#java-interoperability](https://hashnode.com/tag/java-interoperability)

## Written by

[Android Expert](https://hashnode.com/@android-expert)

@android-expert · Chennai, India

  
[View profile](https://hashnode.com/@android-expert)

Android Expert· Kotlin, Jetpack Compose & production pitfalls

Android Engineer &amp; Kotlin Advocate. 🚀 Deep dives into Jetpack Compose, Coroutines, and Clean Architecture. Turning complex code into scalable solutions. 🛠️✨

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
