mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 08:13:44 +01:00
more efficient memory usage
This commit is contained in:
+3
-2
@@ -49,7 +49,7 @@ void ffPrintCPU(FFinstance* instance)
|
||||
fclose(cpuinfo);
|
||||
|
||||
FFstrbuf namePretty;
|
||||
ffStrbufInitA(&namePretty, 256);
|
||||
ffStrbufInitA(&namePretty, 64);
|
||||
ffStrbufAppendS(&namePretty, name);
|
||||
ffStrbufRemoveStrings(&namePretty, 11,
|
||||
"(R)", "(r)", "(TM)", "(tm)", " CPU", " FPU", " Processor", " Dual-Core", " Quad-Core", " Six-Core", " Eight-Core"
|
||||
@@ -66,7 +66,8 @@ void ffPrintCPU(FFinstance* instance)
|
||||
int numProcsOnline = get_nprocs();
|
||||
int numProcsAvailable = get_nprocs_conf();
|
||||
|
||||
FF_STRBUF_CREATE(cpu);
|
||||
FFstrbuf cpu;
|
||||
ffStrbufInitA(&cpu, 128);
|
||||
|
||||
if(instance->config.cpuFormat.length == 0)
|
||||
{
|
||||
|
||||
+2
-1
@@ -35,7 +35,8 @@ static void handleGPU(FFinstance* instance, struct pci_access* pacc, struct pci_
|
||||
char name[512];
|
||||
ffpci_lookup_name(pacc, name, sizeof(name), PCI_LOOKUP_DEVICE, dev->vendor_id, dev->device_id);
|
||||
|
||||
FF_STRBUF_CREATE(gpu);
|
||||
FFstrbuf gpu;
|
||||
ffStrbufInitA(&gpu, 128);
|
||||
|
||||
if(instance->config.gpuFormat.length == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user