mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 08:47:35 +02:00
Added new members for in-memory I/O
This commit is contained in:
parent
a02a1206be
commit
8b3bf050e8
3 changed files with 9 additions and 0 deletions
2
gc.c
2
gc.c
|
@ -495,6 +495,8 @@ char *gc_copy_obj(object dest, char *obj, gc_thread_data * thd)
|
|||
hp->tok_buf_len = ((port_type *) obj)->tok_buf_len;
|
||||
hp->mem_buf = ((port_type *)obj)->mem_buf;
|
||||
hp->mem_buf_len = ((port_type *)obj)->mem_buf_len;
|
||||
hp->str_bv_in_mem_buf = ((port_type *)obj)->str_bv_in_mem_buf;
|
||||
hp->str_bv_in_mem_buf_len = ((port_type *)obj)->str_bv_in_mem_buf_len;
|
||||
hp->read_len = ((port_type *)obj)->read_len;
|
||||
return (char *)hp;
|
||||
}
|
||||
|
|
|
@ -789,6 +789,8 @@ typedef struct {
|
|||
char *mem_buf;
|
||||
size_t mem_buf_len;
|
||||
unsigned short read_len;
|
||||
char *str_bv_in_mem_buf;
|
||||
char *str_bv_in_mem_buf_len;
|
||||
} port_type;
|
||||
|
||||
#define CYC_IO_BUF_LEN 1024
|
||||
|
|
|
@ -3444,6 +3444,11 @@ object Cyc_io_close_port(void *data, object port)
|
|||
((port_type *)port)->mem_buf = NULL;
|
||||
((port_type *)port)->mem_buf_len = 0;
|
||||
}
|
||||
if (((port_type *)port)->str_bv_in_mem_buf != NULL){
|
||||
free( ((port_type *)port)->str_bv_in_mem_buf );
|
||||
((port_type *)port)->str_bv_in_mem_buf = NULL;
|
||||
((port_type *)port)->str_bv_in_mem_buf_len = 0;
|
||||
}
|
||||
if (((port_type *)port)->tok_buf != NULL){
|
||||
free( ((port_type *)port)->tok_buf );
|
||||
((port_type *)port)->tok_buf = NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue