---
title: "Comment by Roman Dawydkin on \"How to return 2+ values with 0 allocation in Kotlin\" | Hashnode"
description: "You are &quot;saving&quot; allocations, but bloating bytecode with inline functions. Is it worth it? And if you remove the inline modifier, there will be alloca"
url: "https://hashnode.com/posts/how-to-return-2-values-with-0-allocation-in-kotlin/61487096699fe76cd34845e5/comment/61b281036a81cf6b31dfd1c0"
---

[Discussion](https://hashnode.com/posts/how-to-return-2-values-with-0-allocation-in-kotlin/61487096699fe76cd34845e5)

Comment [How to return 2+ values with 0 allocation in Kotlin](https://hashnode.com/posts/how-to-return-2-values-with-0-allocation-in-kotlin/61487096699fe76cd34845e5)

[Roman Dawydkin](https://hashnode.com/@Beholder)

[Dec 9, 2021](https://hashnode.com/posts/how-to-return-2-values-with-0-allocation-in-kotlin/61487096699fe76cd34845e5/comment/61b281036a81cf6b31dfd1c0)

You are "saving" allocations, but bloating bytecode with inline functions. Is it worth it? And if you remove the inline modifier, there will be allocations for lambdas. Just let the GC do the work.

[Louis CAD](https://hashnode.com/@LouisCAD)

[Dec 10, 2021](https://hashnode.com/posts/how-to-return-2-values-with-0-allocation-in-kotlin/61487096699fe76cd34845e5/comment/61b281036a81cf6b31dfd1c0#reply-61b33213fccdb516104ba07e)

Inline functions don't all bloat the bytecode. In the example, there's 3 function calls, 3 if/else, and a few local variables introduced.

Using a class would actually lead to more bytecode bloat, I'll let you check that.

Note that I never said to never use a class to return multiple values, I just showed another way, which makes sense in **some** cases like the one I showed.
