Memory Size Hover
VSCode extension that displays the memory size of C/C++ variable types on hover.

Features
- 🔍 Instant memory size display when hovering over types
- 🏗️ Automatic 32-bit and 64-bit architecture support
- 🔧 Compatible with C and C++
- 📊 Supported types: int, float, double, char, pointers, typedefs, etc.
- ✨ Intelligent recognition of compound types (e.g., "long long int", "unsigned long")
- ⚙️ Flexible architecture configuration (auto-detect, target-based, or manual selection)
Installation instruction
From the VSCode marketplace
Search for memory-size-hover in the Extensions tab and install it
Manual installation
- Download the
.vsix file from the github releases
- In VSCode:
ctrl+shift+p → "Extensions: Install from VSIX..."
- Select the downloaded file
Usage
- Open a
.c, .cpp, .h or .hpp file
- Hover any data type
- A tooltip with the memory size will show
Example
int main() {
int number; // Hover → "Memory Size: 4 bytes"
float decimal; // Hover → "Memory Size: 4 bytes"
char* text; // Hover → "Memory Size: 8 bytes" (on 64-bit)
return 0;
}
Configuration
memorySizeHover.showArchitecture: Display architecture in tooltip (default: true)
memorySizeHover.architectureMode: Select architecture detection mode (default: "auto")
- auto: Automatically detects system architecture (original functionality)
- target: Attempts to read architecture from project configuration files
- x32: Forces 32-bit architecture mode
- x64: Forces 64-bit architecture mode
Supported types
- Basic data types:
char, int, float, double, etc.
- Modifiers:
unsigned, signed, long, short
- Pointers:
int*, char*, void*, etc.
- Fixed size types:
int32_t, uint64_t, etc.
- System types:
size_t, ptrdiff_t, etc.
Development
Automatic release
The extension is automaticaly published on the VSCode marketplace when there is a new GitHub release.
Publication workflow :
- Local development : test with the
F5 VSCode debug mode
- New version :
npm run version:patch # or minor/major
- GitHub Release : Create a release on GitHub
- Automatic Publishing : The extension will be automatically published
Useful Commands:
# Local testing
npm run compile
npm run install-local
# Versioning
npm run version:patch # 1.0.0 → 1.0.1
npm run version:minor # 1.0.0 → 1.1.0
npm run version:major # 1.0.0 → 2.0.0
Licence
MIT
| |