Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
3fd3d4a8
Commit
3fd3d4a8
authored
Nov 17, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce memory usage (-28%) by packing index structures.
It is done by using __attribute__((__packed__)) when available.
parent
90548d3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
8 deletions
+25
-8
src/input/es_out_timeshift.c
src/input/es_out_timeshift.c
+25
-8
No files found.
src/input/es_out_timeshift.c
View file @
3fd3d4a8
...
...
@@ -53,6 +53,13 @@
* Local prototypes
*****************************************************************************/
/* XXX attribute_packed is (and MUST be) used ONLY to reduce memory usage */
#ifdef HAVE_ATTRIBUTE_PACKED
# define attribute_packed __attribute__((__packed__))
#else
# define attribute_packed
#endif
enum
{
C_ADD
,
...
...
@@ -61,25 +68,25 @@ enum
C_CONTROL
,
};
typedef
struct
typedef
struct
attribute_packed
{
es_out_id_t
*
p_es
;
es_format_t
*
p_fmt
;
}
ts_cmd_add_t
;
typedef
struct
typedef
struct
attribute_packed
{
es_out_id_t
*
p_es
;
}
ts_cmd_del_t
;
typedef
struct
typedef
struct
attribute_packed
{
es_out_id_t
*
p_es
;
block_t
*
p_block
;
off_t
i_offset
;
int
i_offset
;
/* We do not use file > INT_MAX */
}
ts_cmd_send_t
;
typedef
struct
typedef
struct
attribute_packed
{
int
i_query
;
...
...
@@ -117,9 +124,9 @@ typedef struct
};
}
ts_cmd_control_t
;
typedef
struct
typedef
struct
attribute_packed
{
int
i_type
;
int
8_t
i_type
;
mtime_t
i_date
;
union
{
...
...
@@ -137,7 +144,7 @@ struct ts_storage_t
/* */
char
*
psz_file
;
/* Filename */
int64_t
i_file_max
;
/* Max size in bytes */
size_t
i_file_max
;
/* Max size in bytes */
int64_t
i_file_size
;
/* Current size in bytes */
FILE
*
p_filew
;
/* FILE handle for data writing */
FILE
*
p_filer
;
/* FILE handle for data reading */
...
...
@@ -319,6 +326,16 @@ es_out_t *input_EsOutTimeshiftNew( input_thread_t *p_input, es_out_t *p_next_out
p_sys
->
psz_tmp_path
=
GetTmpPath
(
psz_tmp_path
);
msg_Dbg
(
p_input
,
"using timeshift path '%s'"
,
p_sys
->
psz_tmp_path
);
#if 0
#define S(t) msg_Err( p_input, "SIZEOF("#t")=%d", sizeof(t) )
S(ts_cmd_t);
S(ts_cmd_control_t);
S(ts_cmd_send_t);
S(ts_cmd_del_t);
S(ts_cmd_add_t);
#undef S
#endif
return
p_out
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment