Problem: hak_core_init.inc.h references KPI measurement variables (g_latency_histogram, g_latency_samples, g_baseline_soft_pf, etc.) but hakmem.c was including hak_kpi_util.inc.h AFTER hak_core_init.inc.h, causing undefined reference errors. Solution: Reorder includes so hak_kpi_util.inc.h (definition) comes before hak_core_init.inc.h (usage). Build result: ✅ Success (libhakmem.so 547KB, 0 errors) Minor changes: - Added extern __thread declarations for TLS SLL debug variables - Added signal handler logging for debug_dump_last_push - Improved hakmem_tiny.c structure for Phase 2 preparation 🤖 Generated with Claude Code + Task Agent Co-Authored-By: Gemini <gemini@example.com> Co-Authored-By: Claude <noreply@anthropic.com>
24 lines
541 B
C
24 lines
541 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <sys/mman.h>
|
|
|
|
int main() {
|
|
void* p = malloc(10);
|
|
printf("Malloc ptr: %p\n", p);
|
|
|
|
void* m = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
|
|
printf("Mmap ptr: %p\n", m);
|
|
|
|
unsigned long long addr = (unsigned long long)m;
|
|
if (addr > 0x00007fffffffffffULL) {
|
|
printf("Mmap Address > 48-bit detected!\n");
|
|
} else {
|
|
printf("Mmap Address within 48-bit range.\n");
|
|
}
|
|
|
|
free(p);
|
|
munmap(m, 4096);
|
|
return 0;
|
|
}
|
|
|