mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-24 05:43:53 +00:00
label.c, label.h, wrapper.mod: Don't allocate space for the label table unless it is needed. This reduces startup time, significantly improving performance on the `hello world' benchmark: before after statically linked 0.25s 0.14s dynamically linked 0.68s 0.58s
29 lines
750 B
C
29 lines
750 B
C
/*
|
|
** Copyright (C) 1995 University of Melbourne.
|
|
** This file may only be copied under the terms of the GNU Library General
|
|
** Public License - see the file COPYING.LIB in the Mercury distribution.
|
|
*/
|
|
|
|
#ifndef LABEL_H
|
|
#define LABEL_H
|
|
|
|
#include "dlist.h"
|
|
|
|
typedef struct s_label
|
|
{
|
|
const char *e_name; /* name of the procedure */
|
|
Code *e_addr; /* address of the code */
|
|
} Label;
|
|
|
|
extern void do_init_entries(void);
|
|
extern Label *insert_entry(const char *name, Code *addr);
|
|
extern Label *lookup_label_name(const char *name);
|
|
extern Label *lookup_label_addr(const Code *addr);
|
|
extern List *get_all_labels(void);
|
|
|
|
extern int entry_table_size;
|
|
/* expected number of entries in the table */
|
|
/* we allocate 8 bytes per entry */
|
|
|
|
#endif
|