zpmod  b19981f
High-performance Zsh module for script optimization and filesystem helpers
source_hot.c File Reference

Zcompile hot scripts from source-study data. More...

#include "zpmod.mdh"
#include "zpmod.pro"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for source_hot.c:

Go to the source code of this file.

Data Structures

struct  hot_script_t
 

Functions

static int compare_hot_scripts (const void *a, const void *b)
 
int cmd_source_hot (char *nam, char **argv)
 Implements zpmod source-hot. More...
 

Detailed Description

Zcompile hot scripts from source-study data.

Definition in file source_hot.c.

Function Documentation

◆ cmd_source_hot()

int cmd_source_hot ( char *  nam,
char **  argv 
)

Implements zpmod source-hot.

Parameters
namThe builtin name.
argvSubcommand arguments.
Returns
int 0 on success, 1 on failure.

Definition at line 37 of file source_hot.c.

References arrlen(), compare_hot_scripts(), hot_script_t::count, getaparam(), hot_script_t::path, path, hot_script_t::total_ms, zalloc(), zfree(), zsfree(), ztrdup(), and zwarnnam().

Referenced by bin_zpmod().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compare_hot_scripts()

static int compare_hot_scripts ( const void *  a,
const void *  b 
)
static

Definition at line 23 of file source_hot.c.

References hot_script_t::total_ms.

Referenced by cmd_source_hot().

Here is the caller graph for this function: