quickjs-memory

Guide reference counting and ownership transfer for JSValues in mikrojs native code.

11|Updated Apr 25, 2026
One-click install
npx skills add https://github.com/mikrojs/mikrojs --skill quickjs-memory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: quickjs-memory
Source: https://github.com/mikrojs/mikrojs/tree/main/.agents/skills/quickjs-memory
Command: npx skills add https://github.com/mikrojs/mikrojs --skill quickjs-memory

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides developers through proper handling of memory and ownership for JS values within the mikrojs runtime, preventing leaks and crashes.

Core Features & Use Cases

  • Memory ownership guidance: Explains when to duplicate or free JS values during native module development.
  • Debugging assistance: Assists in troubleshooting reference count issues, leaks, and use-after-free errors in C/C++ code interacting with QuickJS.
  • Use case: Developers writing native extensions for mikrojs can follow best practices to avoid memory bugs and improve stability.

Quick Start

Use this Skill to review the memory management patterns and best practices when working with QuickJS values in mikrojs native modules.

Frequently Asked Questions about quickjs-memory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage memory for JSValues in QuickJS native modules?

To manage JSValue memory in QuickJS native modules, follow reference counting guidance to duplicate or free values during ownership transfers, preventing leaks and crashes in C++ code.

Why does my QuickJS C++ extension crash with a use-after-free error?

Use-after-free errors in QuickJS C++ extensions occur when JSValue reference counts are mishandled, causing premature freeing; troubleshooting reference count issues helps identify and resolve these memory bugs.

When do I need to duplicate or free JSValues in mikrojs native code?

You need to duplicate or free JSValues in mikrojs native code during memory ownership transfers, ensuring proper reference counting to safely pass values across function boundaries without leaks.

What is the best way to prevent memory leaks in QuickJS JavaScript runtime extensions?

The best way to prevent memory leaks in QuickJS extensions is applying reference counting best practices, ensuring every allocated JSValue is properly tracked and freed when no longer needed.

Can I use this memory management guidance for troubleshooting reference count issues?

Yes, you can use this guidance for troubleshooting reference count issues, as it assists in diagnosing leaks and use-after-free errors in C/C++ code interacting with QuickJS.