Порты brotli и freetype на Crystal — это код в C-стиле: предаллоцированные
буферы, индексы вместо указателей, unsafe_fetch, uninitialized,
@[AlwaysInline] (сотни вхождений). Аллокаций в горячем пути ноль, GC
молчит. И всё равно на hot loops остаётся типичный разрыв в 15–40% до C.
Языковых средств, которые C даёт из коробки, в Crystal просто нет —
и дело не в GC и не в «медленном рантайме», а в четырёх конкретных
On an s2idle-only Meteor Lake laptop, suspend hung ~50% of the time with a black screen and required a hard reset. The culprit was not the GPU driver — it was the SSD: the YMTC PC300 NVMe drive stops completing I/O when its PCIe link is allowed to enter deep ASPM states (L1/L1.1/L1.2) around sleep transitions.
Fix — disable link power management for the drive + drive-side APST:
Tested on: QEMU 9.2.1, macOS Guest (Big Sur – Sequoia), Host OS: Ubuntu 24.04 / GNOME (X11)
Display:vmware-svga(no GPU passthrough)
Note: In macOS System Information (About This Mac) you will still see 3–7 MB of Video Memory regardless of QEMU settings. This is expected and not a problem. Thevgamem_mbparameter does not affect the macOS driver or framebuffer performance — do not chase this dead end.> Resolution: 1920×1080
| //! NoPanic - Complete set of rules to forbid panics and dangerous constructs | |
| //! | |
| //! This file contains crate-level attributes to forbid compilation | |
| //! with methods that can cause panics or unsafe operations. | |
| //! | |
| //! Include at the beginning of main.rs via: include!("nopanic.rs"); | |
| // ============================================================================ | |
| // FORBID PANIC METHODS (deny - compilation error) | |
| // ============================================================================ |
| # DXVK Project: https://github.com/doitsujin/dxvk | |
| # | |
| # | |
| # Override PCI vendor and device IDs reported to the application. Can | |
| # cause the app to adjust behaviour depending on the selected values. | |
| # | |
| # Supported values: Any four-digit hex number. | |
| # dxgi.customDeviceId = 0000 | |
| dxgi.customVendorId = 10de |
| class Buffer | |
| attr_reader :buffer, :overflows | |
| def initialize(&block) | |
| @limitation_criteria = block | |
| @buffer = [] | |
| @overflows = 0 | |
| end | |
| def set_action(&block) |
| # Something like Rails helper, but with short M instead of Million | |
| def short_number_to_human(n) | |
| postfix = { 1 => "", 10**3 => "K", 10**6 => "M", 10**9 => "B"} | |
| key = postfix.keys.select{|k| n/k.to_f >= 1}.max | |
| "#{(n/key.to_f).round}#{postfix[key]}" | |
| end |
Problem is after installation from official site postgresql was not found:
locate bin/psql
Then we got /Library/PostgreSQL/10/bin/psql. Add this to PATH variable in .profile
export PATH=/Library/PostgreSQL/10/bin:$PATH
Problem:
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Try this:
| require_relative 'helpers/handle_errors' | |
| require 'ostruct' | |
| require 'phone' | |
| class ParsedStore < OpenStruct | |
| include HandleErrorsHelper | |
| def initialize(*args) | |
| super(*args) |