mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Began migration of job_t away from halloc
This commit is contained in:
parent
f243cd86c9
commit
966cd6a8ca
2 changed files with 20 additions and 13 deletions
3
proc.cpp
3
proc.cpp
|
@ -213,8 +213,7 @@ job_t *job_create()
|
|||
|
||||
while( job_get( free_id ) != 0 )
|
||||
free_id++;
|
||||
res = (job_t *)halloc( 0, sizeof(job_t) );
|
||||
res->job_id = free_id;
|
||||
res = new job_t(free_id);
|
||||
job_list().push_front(res);
|
||||
|
||||
job_set_flag( res,
|
||||
|
|
28
proc.h
28
proc.h
|
@ -124,8 +124,9 @@ enum
|
|||
element, which is the block of commands to execute.
|
||||
|
||||
*/
|
||||
typedef struct process
|
||||
class process_t
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Type of process. Can be one of \c EXTERNAL, \c
|
||||
INTERNAL_BUILTIN, \c INTERNAL_FUNCTION, \c INTERNAL_BLOCK,
|
||||
|
@ -161,15 +162,14 @@ typedef struct process
|
|||
int count_help_magic;
|
||||
|
||||
/** next process in pipeline */
|
||||
struct process *next;
|
||||
struct process_t *next;
|
||||
#ifdef HAVE__PROC_SELF_STAT
|
||||
/** Last time of cpu time check */
|
||||
struct timeval last_time;
|
||||
/** Number of jiffies spent in process at last cpu time check */
|
||||
unsigned long last_jiffies;
|
||||
#endif
|
||||
}
|
||||
process_t;
|
||||
};
|
||||
|
||||
/**
|
||||
Constant for the flag variable in the job struct
|
||||
|
@ -237,6 +237,19 @@ typedef struct process
|
|||
class job_t
|
||||
{
|
||||
public:
|
||||
|
||||
job_t(int jobid) :
|
||||
command(NULL),
|
||||
first_process(NULL),
|
||||
pgid(0),
|
||||
tmodes(),
|
||||
job_id(jobid),
|
||||
io(NULL),
|
||||
flags(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
The original command which led to the creation of this
|
||||
job. It is used for displaying messages about job status
|
||||
|
@ -268,18 +281,13 @@ class job_t
|
|||
unique identifier of the job within this shell, and is
|
||||
used e.g. in process expansion.
|
||||
*/
|
||||
int job_id;
|
||||
const int job_id;
|
||||
|
||||
/**
|
||||
List of all IO redirections for this job
|
||||
*/
|
||||
io_data_t *io;
|
||||
|
||||
/**
|
||||
A pointer to the next job in the job queue
|
||||
*/
|
||||
//struct job *next;
|
||||
|
||||
/**
|
||||
Bitset containing information about the job. A combination of the JOB_* constants.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue