mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Downsize big char arrays in shader structs - a lot of these get
allocated on the stack so this would cost a lot of memory
This commit is contained in:
parent
cfbfd01f38
commit
046c2375e7
@ -178,7 +178,7 @@ struct video_shader_pass
|
||||
char *vertex; /* Dynamically allocated. Must be free'd. */
|
||||
char *fragment; /* Dynamically allocated. Must be free'd. */
|
||||
} string;
|
||||
char path[PATH_MAX_LENGTH];
|
||||
char path[NAME_MAX_LENGTH*2];
|
||||
} source;
|
||||
char alias[64];
|
||||
uint8_t flags;
|
||||
@ -189,7 +189,7 @@ struct video_shader_lut
|
||||
unsigned filter;
|
||||
enum gfx_wrap_type wrap;
|
||||
char id[64];
|
||||
char path[PATH_MAX_LENGTH];
|
||||
char path[NAME_MAX_LENGTH*2];
|
||||
bool mipmap;
|
||||
};
|
||||
|
||||
|
@ -139,6 +139,14 @@ static INLINE bool bits_any_different(uint32_t *a, uint32_t *b, uint32_t count)
|
||||
#define DIR_MAX_LENGTH 256
|
||||
#endif
|
||||
|
||||
/**
|
||||
* An upper limit for the length of a file or directory (excluding parent directories).
|
||||
* If a path has a component longer than this, it may not work properly.
|
||||
*/
|
||||
#ifndef NAME_MAX_LENGTH
|
||||
#define NAME_MAX_LENGTH 128
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifndef PATH_MAX_LENGTH
|
||||
@ -149,8 +157,6 @@ static INLINE bool bits_any_different(uint32_t *a, uint32_t *b, uint32_t count)
|
||||
#define DIR_MAX_LENGTH 1024
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* An upper limit for the length of a file or directory (excluding parent directories).
|
||||
* If a path has a component longer than this, it may not work properly.
|
||||
@ -159,6 +165,9 @@ static INLINE bool bits_any_different(uint32_t *a, uint32_t *b, uint32_t count)
|
||||
#define NAME_MAX_LENGTH 256
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef MAX
|
||||
/**
|
||||
* @return \c a or \c b, whichever is larger.
|
||||
|
Loading…
x
Reference in New Issue
Block a user