Skip to content

Instantly share code, notes, and snippets.

Avatar

Geoffrey Hunter gbmhunter

View GitHub Profile
@gbmhunter
gbmhunter / GetLinuxProcessMemoryCpp.cpp
Last active Aug 29, 2021
Code example showing how to get the memory used by the current Linux process in C/C++.
View GetLinuxProcessMemoryCpp.cpp
#include "sys/types.h"
#include "sys/sysinfo.h"
int parseLine(char *line) {
// This assumes that a digit will be found and the line ends in " Kb".
int i = strlen(line);
const char *p = line;
while (*p < '0' || *p > '9') p++;
line[i - 3] = '\0';
i = atoi(p);
View this-bug-in-lambda.s
.cpu cortex-a9
.eabi_attribute 28, 1
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 2
.eabi_attribute 34, 1