# tagged pointers

Published articles for tagged pointers.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## C++29 -- начало. Встреча ISO C++ в Брно

DevFeed: [C++29 -- начало. Встреча ISO C++ в Брно](<https://devfeed.tech/articles/c-29-iso-c-24878.md>)

Original publisher: [Read original article](<https://habr.com/ru/companies/yandex/articles/1067348/>)

Author: antoshkka (Яндекс)

Published: 2026-08-17T07:01:31Z

Content type: article

Language: ru

Sources: [Яндекс - Как мы делаем Яндекс / Статьи](<https://devfeed.tech/sources/source.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [floating-point](<https://devfeed.tech/topics/floating-point.md>), [implementation](<https://devfeed.tech/topics/implementation.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [c-plus-plus-29](<https://devfeed.tech/tags/c-plus-plus-29.md>), [floating-point](<https://devfeed.tech/tags/floating-point.md>), [fmt](<https://devfeed.tech/tags/fmt.md>), [format](<https://devfeed.tech/tags/format.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [iso](<https://devfeed.tech/tags/iso.md>), [standard](<https://devfeed.tech/tags/standard.md>), [standard-library](<https://devfeed.tech/tags/standard-library.md>), [tagged-pointers](<https://devfeed.tech/tags/tagged-pointers.md>), [thread](<https://devfeed.tech/tags/thread.md>), [threads](<https://devfeed.tech/tags/threads.md>), [undefined-behavior](<https://devfeed.tech/tags/undefined-behavior.md>), [undefined-behaviour](<https://devfeed.tech/tags/undefined-behaviour.md>)

### AI overview

A report on the ISO C++ committee meeting in Brno, where work on C++29 began. It describes plans to organize and clarify documented undefined behavior and ill-formed-no-diagnostic-required cases, along with changes involving constexpr floating-point evaluation and other language rules.

### Source excerpt

Привет! На связи Антон Полухин из Техплатформы Городских сервисов Яндекса. Недавно в Брно состоялась встреча международного комитета по стандартизации языка программирования C++, в которой я принимал активное участие. В этот раз началась работа над C++29 и как раз о новинках и хочется рассказать. Читать далее

## Eliminating Intermediate Array Allocations

DevFeed: [Eliminating Intermediate Array Allocations](<https://devfeed.tech/articles/eliminating-intermediate-array-allocations-38999.md>)

Original publisher: [Read original article](<https://tenderlovemaking.com/2024/09/29/eliminating-intermediate-array-allocations/>)

Published: 2024-09-30T02:06:28Z

Content type: tutorial

Language: en

Sources: [Aaron Patterson](<https://devfeed.tech/sources/aaron-patterson.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [Code](<https://devfeed.tech/topics/code.md>), [tagged pointers](<https://devfeed.tech/topics/tagged-pointers.md>), [math](<https://devfeed.tech/topics/math.md>)

Tags: [array](<https://devfeed.tech/tags/array.md>), [code](<https://devfeed.tech/tags/code.md>), [function](<https://devfeed.tech/tags/function.md>), [gc](<https://devfeed.tech/tags/gc.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [tagged-pointers](<https://devfeed.tech/tags/tagged-pointers.md>)

### AI overview

This Ruby article explains how to measure object allocations with GC.stat and distinguishes code that never, sometimes, or always allocates. It focuses on why an intermediate array used in certain min or max calculations can be allocated on the stack and discarded without requesting a new object from the garbage collector.

### Source excerpt

Recently I gave a talk at RailsWorld (hopefully they'll post the video soon), and part of my presentation was about eliminating allocations in tokenizers. I presented a simple function for measuring allocations: def allocations x = GC.stat(:total_allocated_objects) yield GC.stat(:total_allocated_objects) - x end Everything in Ruby is an object, but not all objects actually make allocations. We can use the above function to measure allocations made in a block. Here are some examples of code that never allocate: p allocations { true } # => 0 p allocations { false } # => 0 p allocations { nil } # => 0 p allocations { :hello } # => 0 p allocations { 1 } # => 0 p allocations { 2.3 } # => 0 p allocations { 0xFFFF_FFFF_FFFF_FFFF } # => 0 Literals like booleans, nil, symbols, integers, and floats are represented internally to CRuby as "tagged pointers" and they don't allocate anything when executed. Here is an example of code that sometimes allocates: # Depends on the size of the number p allocations { 1 + 2 } # => 0 p allocations { 0x3FFF_FFFF_FFFF_FFFF + 1 } # => 1 # Depends on `frozen_string_literal` p allocations { "hello!" } # => 0 or 1 Math on integers generally doesn't allocate anything, but it depends on the integer. When a number gets large enough, CRuby will allocate an object to represent that number. On 64 bit platforms, the largest whole number we can represent without allocating is 0x3FFF_FFFF_FFFF_FFFF. String literals will sometimes allocate, but it depends on the frozen_string_literal setting in your program. Here is an example of code that always allocates: p allocations { [1, 2] } # => 1 p allocations { { a: :b } } # => 1 p allocations { Object.new } # => 1 p allocations { "foo"[0, 1] } # => 1 Hopefully these examples are fairly straightforward. Arrays, hashes, objects, string slices, etc will allocate an object. Eliminating Intermediate Array Allocations At the Shopify after-party at RailsWorld, someone asked me a really great question. Their codebase ha